Skip to content

Commit 99fdfed

Browse files
committed
Get another test in AssertionsSpec to pass.
1 parent 46f7bc4 commit 99fdfed

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scalatest-test/src/test/scala/org/scalatest/AssertionsSpec.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -894,20 +894,20 @@ class AssertionsSpec extends AnyFunSpec {
894894
assert(a == 3 && { println("hi"); b == 5})
895895
}
896896

897-
// SKIP-DOTTY-START
898897
it("should throw TestFailedException with correct message and stack depth when is usesd to check a == 3 && { println(\"hi\"); b == 3}") {
899898
val e = intercept[TestFailedException] {
900899
assert(a == 3 && { println("hi"); b == 3})
901900
}
902901
if (ScalaTestVersions.BuiltForScalaVersion == "2.12" || ScalaTestVersions.BuiltForScalaVersion == "2.13")
903902
assert(e.message == Some(commaBut(equaled(3, 3), wasFalse("{" + Prettifier.lineSeparator + " scala.Predef.println(\"hi\");" + Prettifier.lineSeparator + " b.==(3)" + Prettifier.lineSeparator + "}"))))
904-
else
903+
else if (ScalaTestVersions.BuiltForScalaVersion == "2.10" || ScalaTestVersions.BuiltForScalaVersion == "2.11")
905904
assert(e.message == Some(commaBut(equaled(3, 3), wasFalse("{" + Prettifier.lineSeparator + " scala.this.Predef.println(\"hi\");" + Prettifier.lineSeparator + " b.==(3)" + Prettifier.lineSeparator + "}"))))
905+
else // for dotty
906+
assert(e.message == Some(commaBut(equaled(3, 3), wasFalse("{" + Prettifier.lineSeparator + " scala.Predef.println(\"hi\")" + Prettifier.lineSeparator + " b.==(3)" + Prettifier.lineSeparator + "}"))))
906907
assert(e.failedCodeFileName == (Some(fileName)))
907-
assert(e.failedCodeLineNumber == (Some(thisLineNumber - 7)))
908+
assert(e.failedCodeLineNumber == (Some(thisLineNumber - 9)))
908909
}
909-
// SKIP-DOTTY-END
910-
910+
911911
it("should do nothing when it is used to check { println(\"hi\"); b == 5} && a == 3") {
912912
assert({ println("hi"); b == 5} && a == 3)
913913
}

0 commit comments

Comments
 (0)