Skip to content

Commit a8213e8

Browse files
committed
Fix evaluation tests
1 parent 2936738 commit a8213e8

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

modules/tests/src/test/scala/ch/epfl/scala/debugadapter/ScalaEvaluationTests.scala

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,6 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
673673
check(
674674
Breakpoint(6),
675675
DebugStepAssert.inParallel(Evaluation.success("n", 1), Evaluation.success("m1()", 9)),
676-
if (isScala3 && scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(9) else NoStep(),
677676
Breakpoint(9),
678677
DebugStepAssert.inParallel(Evaluation.success("n", 1), Evaluation.success("m1()", 9))
679678
)
@@ -1855,7 +1854,7 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
18551854
check(Breakpoint(6), Evaluation.success("x\nx", "Hello"))
18561855
}
18571856

1858-
test("on for loops, generators and guards") {
1857+
test("loops, generators and guards") {
18591858
val source =
18601859
"""|package example
18611860
|
@@ -1884,15 +1883,13 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
18841883
Breakpoint(8),
18851884
DebugStepAssert.inParallel(Evaluation.success("list(0)", 1), Evaluation.success("x", 1)),
18861885
Breakpoint(9), // calling map
1887-
if (scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(9) else NoStep(),
18881886
Evaluation.success("x + y", 2), // finally we are into the lifted lambda x + y
18891887
Breakpoint(8), // still in the same lifted lambda (the line position does not make any sense)
18901888
Breakpoint(9), // again in the lifted lambda
18911889
Breakpoint(8), // going out of the lifted lambda
18921890
Breakpoint(8), // regression in Scala 3.2.2
18931891
Breakpoint(9), // regression in Scala 3.2.2
18941892
Breakpoint(13), // calling withFilter
1895-
if (scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(13) else NoStep(),
18961893
Evaluation.success("x", 1),
18971894
Breakpoint(15),
18981895
Evaluation.success("list(0)", 1),
@@ -2314,11 +2311,7 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
23142311
| b.m1()
23152312
|""".stripMargin
23162313
implicit val debuggee: TestingDebuggee = TestingDebuggee.mainClass(source, "example.Main", scalaVersion)
2317-
check(
2318-
if (isScala33) Breakpoint(8) else NoStep(), // Stops once in the constructor of B
2319-
Breakpoint(8),
2320-
Evaluation.success("x1 + x2 + x3", "x1x2x3")
2321-
)
2314+
check(Breakpoint(8), Evaluation.success("x1 + x2 + x3", "x1x2x3"))
23222315
}
23232316

23242317
test("brace-less syntax: evaluate in package") {
@@ -2574,8 +2567,6 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
25742567
implicit val debuggee: TestingDebuggee = TestingDebuggee.mainClass(source, "example.Main", scalaVersion)
25752568
check(
25762569
Breakpoint(12),
2577-
if (isScala33) Breakpoint(12) else NoStep(),
2578-
if (isScala33) Breakpoint(15) else NoStep(),
25792570
Breakpoint(20),
25802571
DebugStepAssert.inParallel(Evaluation.success("A.A1.a", 1), Evaluation.success("A.A2.a", 2)),
25812572
Breakpoint(15),

modules/tests/src/test/scala/ch/epfl/scala/debugadapter/internal/RuntimeEvaluatorTests.scala

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,11 +1151,7 @@ abstract class ScalaRuntimeEvaluatorTests(val scalaVersion: ScalaVersion) extend
11511151
|}
11521152
|""".stripMargin
11531153
implicit val debuggee: TestingDebuggee = TestingDebuggee.mainClass(source, "example.Main", scalaVersion)
1154-
check(
1155-
Breakpoint(6),
1156-
if (scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(6) else NoStep(),
1157-
Evaluation.success("n", 1)
1158-
)
1154+
check(Breakpoint(6), Evaluation.success("n", 1))
11591155
}
11601156

11611157
test("evaluate captured local variable shadowing captured variable") {
@@ -1222,7 +1218,7 @@ abstract class ScalaRuntimeEvaluatorTests(val scalaVersion: ScalaVersion) extend
12221218
)
12231219
}
12241220

1225-
test("evaluate on for loops, generators and guards") {
1221+
test("loops, generators and guards") {
12261222
assume(scalaVersion.isScala3)
12271223
val source =
12281224
"""|package example
@@ -1247,15 +1243,13 @@ abstract class ScalaRuntimeEvaluatorTests(val scalaVersion: ScalaVersion) extend
12471243
Breakpoint(8),
12481244
Evaluation.success("x", 1),
12491245
Breakpoint(9), // calling map
1250-
if (scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(9) else NoStep(),
12511246
Evaluation.success("y", 1), // finally we are into the lifted lambda x + y
12521247
Breakpoint(8), // still in the same lifted lambda (the line position does not make any sense)
12531248
Breakpoint(9), // again in the lifted lambda
12541249
Breakpoint(8), // going out of the lifted lambda
12551250
Breakpoint(8), // regression in Scala 3.2.2
12561251
Breakpoint(9), // regression in Scala 3.2.2
12571252
Breakpoint(13), // calling withFilter
1258-
if (scalaVersion < ScalaVersion.`3.5.0`) Breakpoint(13) else NoStep(),
12591253
Evaluation.success("x", 1)
12601254
)
12611255
}

0 commit comments

Comments
 (0)