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:
27
27
@ Test def verifyImports : Unit =
28
28
val expressionLines = List (
29
29
" 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) """ ,
32
31
)
33
32
val expression = expressionLines.mkString(" ;" )
34
- testExpression(expression){ result =>
33
+ val success = testExpression(expression){ result =>
35
34
result.matches(" [0-9]+" ) && result.toInt > 0
36
35
}
36
+ assert(success)
37
37
38
38
def getResult (expression : String ): String =
39
39
val cmd = s " bin/scala -e $expression"
@@ -42,7 +42,7 @@ class ExpressionTest:
42
42
printf(" stderr: %s\n " , stderr.mkString(" \n " ," \n " ," " ))
43
43
stdout.filter(_.nonEmpty).mkString(" " )
44
44
45
- def testExpression (expression : String )(check : (result : String ) => Boolean ) = {
45
+ def testExpression (expression : String )(check : (result : String ) => Boolean ): Boolean = {
46
46
val result = getResult(expression)
47
47
check(result)
48
48
}
You can’t perform that action at this time.
0 commit comments