File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
compiler/test/dotty/tools/scripting Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments