Skip to content

Commit

Permalink
Fix evaluation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adpi2 committed Sep 5, 2024
1 parent 2936738 commit a8213e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,6 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
check(
Breakpoint(6),
DebugStepAssert.inParallel(Evaluation.success("n", 1), Evaluation.success("m1()", 9)),
if (isScala3 && scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(9) else NoStep(),
Breakpoint(9),
DebugStepAssert.inParallel(Evaluation.success("n", 1), Evaluation.success("m1()", 9))
)
Expand Down Expand Up @@ -1855,7 +1854,7 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
check(Breakpoint(6), Evaluation.success("x\nx", "Hello"))
}

test("on for loops, generators and guards") {
test("loops, generators and guards") {
val source =
"""|package example
|
Expand Down Expand Up @@ -1884,15 +1883,13 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
Breakpoint(8),
DebugStepAssert.inParallel(Evaluation.success("list(0)", 1), Evaluation.success("x", 1)),
Breakpoint(9), // calling map
if (scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(9) else NoStep(),
Evaluation.success("x + y", 2), // finally we are into the lifted lambda x + y
Breakpoint(8), // still in the same lifted lambda (the line position does not make any sense)
Breakpoint(9), // again in the lifted lambda
Breakpoint(8), // going out of the lifted lambda
Breakpoint(8), // regression in Scala 3.2.2
Breakpoint(9), // regression in Scala 3.2.2
Breakpoint(13), // calling withFilter
if (scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(13) else NoStep(),
Evaluation.success("x", 1),
Breakpoint(15),
Evaluation.success("list(0)", 1),
Expand Down Expand Up @@ -2314,11 +2311,7 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
| b.m1()
|""".stripMargin
implicit val debuggee: TestingDebuggee = TestingDebuggee.mainClass(source, "example.Main", scalaVersion)
check(
if (isScala33) Breakpoint(8) else NoStep(), // Stops once in the constructor of B
Breakpoint(8),
Evaluation.success("x1 + x2 + x3", "x1x2x3")
)
check(Breakpoint(8), Evaluation.success("x1 + x2 + x3", "x1x2x3"))
}

test("brace-less syntax: evaluate in package") {
Expand Down Expand Up @@ -2574,8 +2567,6 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
implicit val debuggee: TestingDebuggee = TestingDebuggee.mainClass(source, "example.Main", scalaVersion)
check(
Breakpoint(12),
if (isScala33) Breakpoint(12) else NoStep(),
if (isScala33) Breakpoint(15) else NoStep(),
Breakpoint(20),
DebugStepAssert.inParallel(Evaluation.success("A.A1.a", 1), Evaluation.success("A.A2.a", 2)),
Breakpoint(15),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1151,11 +1151,7 @@ abstract class ScalaRuntimeEvaluatorTests(val scalaVersion: ScalaVersion) extend
|}
|""".stripMargin
implicit val debuggee: TestingDebuggee = TestingDebuggee.mainClass(source, "example.Main", scalaVersion)
check(
Breakpoint(6),
if (scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(6) else NoStep(),
Evaluation.success("n", 1)
)
check(Breakpoint(6), Evaluation.success("n", 1))
}

test("evaluate captured local variable shadowing captured variable") {
Expand Down Expand Up @@ -1222,7 +1218,7 @@ abstract class ScalaRuntimeEvaluatorTests(val scalaVersion: ScalaVersion) extend
)
}

test("evaluate on for loops, generators and guards") {
test("loops, generators and guards") {
assume(scalaVersion.isScala3)
val source =
"""|package example
Expand All @@ -1247,15 +1243,13 @@ abstract class ScalaRuntimeEvaluatorTests(val scalaVersion: ScalaVersion) extend
Breakpoint(8),
Evaluation.success("x", 1),
Breakpoint(9), // calling map
if (scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(9) else NoStep(),
Evaluation.success("y", 1), // finally we are into the lifted lambda x + y
Breakpoint(8), // still in the same lifted lambda (the line position does not make any sense)
Breakpoint(9), // again in the lifted lambda
Breakpoint(8), // going out of the lifted lambda
Breakpoint(8), // regression in Scala 3.2.2
Breakpoint(9), // regression in Scala 3.2.2
Breakpoint(13), // calling withFilter
if (scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(13) else NoStep(),
Evaluation.success("x", 1)
)
}
Expand Down

0 comments on commit a8213e8

Please sign in to comment.