add one test case

This commit is contained in:
jilen 2024-12-15 21:11:14 +08:00
parent 8103d45178
commit a0ceea91a9
3 changed files with 18 additions and 3 deletions

View file

@ -1,8 +1,9 @@
name := "minisql" name := "minisql"
scalaVersion := "3.6.2" scalaVersion := "3.5.2"
libraryDependencies ++= Seq( libraryDependencies ++= Seq(
"org.scalameta" %% "munit" % "1.0.3" % Test
) )
scalacOptions ++= Seq("-experimental", "-language:experimental.namedTuples") scalacOptions ++= Seq("-experimental", "-language:experimental.namedTuples")

View file

@ -75,7 +75,7 @@ private[minisql] object Parsing {
.orElse(ifParser) .orElse(ifParser)
.orElse(traversableOperationParser) .orElse(traversableOperationParser)
.orElse(patMatchParser) .orElse(patMatchParser)
.orElse(infixParser) // .orElse(infixParser)
.orElse { .orElse {
case o => case o =>
val str = scala.util.Try(o.show).getOrElse("") val str = scala.util.Try(o.show).getOrElse("")
@ -122,7 +122,7 @@ private[minisql] object Parsing {
} }
lazy val patMatchParser: Parser[ast.Ast] = patMatchParsing(astParser) lazy val patMatchParser: Parser[ast.Ast] = patMatchParsing(astParser)
lazy val infixParser: Parser[ast.Infix] = infixParsing(astParser) // lazy val infixParser: Parser[ast.Infix] = infixParsing(astParser)
lazy val traversableOperationParser: Parser[ast.IterableOperation] = lazy val traversableOperationParser: Parser[ast.IterableOperation] =
traversableOperationParsing(astParser) traversableOperationParsing(astParser)

View file

@ -0,0 +1,14 @@
package minisql.parsing
import minisql.ast.*
class ParsingSuite extends munit.FunSuite {
inline def testParseInline(inline x: Any, ast: Ast) = {
assertEquals(Parsing.parse(x), Ident("x"))
}
test("Ident") {
val x = 1
}
}