Skip to content

Commit 8756d2c

Browse files
committed
addresses compile error mentioned in #14332
1 parent c4494f9 commit 8756d2c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/test/dotty/tools/scripting/ExpressionTest.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ class ExpressionTest:
2727
@Test def verifyImports: Unit =
2828
val expressionLines = List(
2929
"import java.nio.file.Paths",
30-
"""val cwd = Paths.get(""."")""",
31-
"""println(cwd.toFile.listFiles.toList.filter(_.isDirectory).size)""",
30+
s"""println(Paths.get("\""."\"").toFile.listFiles.toList.filter(_.isDirectory).size)""",
3231
)
3332
val expression = expressionLines.mkString(";")
34-
testExpression(expression){ result =>
33+
val success = testExpression(expression){ result =>
3534
result.matches("[0-9]+") && result.toInt > 0
3635
}
36+
assert(success)
3737

3838
def getResult(expression: String): String =
3939
val cmd = s"bin/scala -e $expression"
@@ -42,7 +42,7 @@ class ExpressionTest:
4242
printf("stderr: %s\n", stderr.mkString("\n","\n",""))
4343
stdout.filter(_.nonEmpty).mkString("")
4444

45-
def testExpression(expression: String)(check: (result: String) => Boolean) = {
45+
def testExpression(expression: String)(check: (result: String) => Boolean): Boolean = {
4646
val result = getResult(expression)
4747
check(result)
4848
}

0 commit comments

Comments
 (0)