From a0ceea91a9bb6bfa0aba0f2e7d3bc91df4ff7124 Mon Sep 17 00:00:00 2001 From: jilen Date: Sun, 15 Dec 2024 21:11:14 +0800 Subject: [PATCH] add one test case --- build.sbt | 3 ++- src/main/scala/minisql/parsing/Parsing.scala | 4 ++-- src/test/scala/minisql/parsing/ParsingSuite.scala | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 src/test/scala/minisql/parsing/ParsingSuite.scala diff --git a/build.sbt b/build.sbt index 0a952af..2dc3b9c 100644 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,9 @@ name := "minisql" -scalaVersion := "3.6.2" +scalaVersion := "3.5.2" libraryDependencies ++= Seq( + "org.scalameta" %% "munit" % "1.0.3" % Test ) scalacOptions ++= Seq("-experimental", "-language:experimental.namedTuples") diff --git a/src/main/scala/minisql/parsing/Parsing.scala b/src/main/scala/minisql/parsing/Parsing.scala index 463112f..07da46a 100644 --- a/src/main/scala/minisql/parsing/Parsing.scala +++ b/src/main/scala/minisql/parsing/Parsing.scala @@ -75,7 +75,7 @@ private[minisql] object Parsing { .orElse(ifParser) .orElse(traversableOperationParser) .orElse(patMatchParser) - .orElse(infixParser) + // .orElse(infixParser) .orElse { case o => 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 infixParser: Parser[ast.Infix] = infixParsing(astParser) + // lazy val infixParser: Parser[ast.Infix] = infixParsing(astParser) lazy val traversableOperationParser: Parser[ast.IterableOperation] = traversableOperationParsing(astParser) diff --git a/src/test/scala/minisql/parsing/ParsingSuite.scala b/src/test/scala/minisql/parsing/ParsingSuite.scala new file mode 100644 index 0000000..043346d --- /dev/null +++ b/src/test/scala/minisql/parsing/ParsingSuite.scala @@ -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 + } +}