From 160e8bcc1af64675a47232a18588e64524f812cf Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Fri, 31 Jan 2025 15:53:12 +0000 Subject: [PATCH] refactor: simplify expectedResult type in tests --- src/test/wacc/examples.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/wacc/examples.scala b/src/test/wacc/examples.scala index 6400646..ef48195 100644 --- a/src/test/wacc/examples.scala +++ b/src/test/wacc/examples.scala @@ -11,16 +11,16 @@ class ParallelExamplesSpec with ParallelTestExecution { val files = allWaccFiles("wacc-examples/valid").map { p => - (p.toString, (_: Int) == 0) + (p.toString, List(0)) } ++ allWaccFiles("wacc-examples/invalid/syntaxErr").map { p => - (p.toString, (_: Int) == 100) + (p.toString, List(100)) } ++ allWaccFiles("wacc-examples/invalid/semanticErr").map { p => - (p.toString, (_: Int) == 200) + (p.toString, List(200)) } ++ allWaccFiles("wacc-examples/invalid/whack").map { p => - (p.toString, List(0, 100, 200).contains) + (p.toString, List(0, 100, 200)) } // tests go here @@ -30,7 +30,7 @@ class ParallelExamplesSpec s"$filename" should "be parsed with correct result" in { val contents = os.read(os.Path(filename)) parser.parse(contents) match { - case Success(x) => assert(expectedResult(x.toInt)) + case Success(x) => assert(expectedResult.contains(x)) case Failure(msg) => fail(msg) } }