@@ -60,30 +60,45 @@ object Test {
60
60
" <<<<<<<<<<<<<<<<<<"
61
61
)
62
62
63
- compileAndInterpret(" HelloWorld" )
64
- // compileAndInterpret("i3518")
65
- // compileAndInterpret("withIndex")
63
+ compileAndInterpret(" HelloWorld.scala" )
64
+ compileAndInterpret(" nullInstanceEval.scala" )
65
+ compileAndInterpret(" t3327.scala" )
66
+ // compileAndInterpret("t5614.scala")
67
+ // compileAndInterpret("t4054.scala")
68
+ // compileAndInterpret("sort.scala")
69
+ // compileAndInterpret("t0607.scala")
70
+ // compileAndInterpret("i4073b.scala")
71
+ // compileAndInterpret("i4430.scala")
72
+ // compileAndInterpret("nullAsInstanceOf.scala")
73
+ // compileAndInterpret("classof.scala")
74
+ // compileAndInterpret("null-hash.scala")
75
+ // compileAndInterpret("i3518.scala")
76
+ // compileAndInterpret("withIndex.scala")
77
+ // compileAndInterpret("unboxingBug.scala")
78
+ // compileAndInterpret("traitInit.scala")
66
79
}
67
80
68
- def compileAndInterpret (testName : String ) = {
81
+ def compileAndInterpret (testFileName : String ) = {
69
82
val reproter = new Reporter {
70
83
def doReport (m : MessageContainer )(implicit ctx : Contexts .Context ): Unit = println(m)
71
84
}
72
85
val out = java.nio.file.Paths .get(" out/interpreted" )
73
86
if (! java.nio.file.Files .exists(out))
74
87
java.nio.file.Files .createDirectory(out)
75
- dotty.tools.dotc.Main .process(Array (" -classpath" , System .getProperty(" java.class.path" ), " -d" , out.toString, " tests/run/" + testName + " .scala " ), reproter)
88
+ dotty.tools.dotc.Main .process(Array (" -classpath" , System .getProperty(" java.class.path" ), " -d" , out.toString, " tests/run/" + testFileName ), reproter)
76
89
77
90
val actualOutput = interpret(out.toString)(" Test" )
78
91
79
- val checkFile = java.nio.file.Paths .get(" tests/run/" + testName + " .check" )
80
- val expectedOutput = Source .fromFile(checkFile.toFile).getLines().mkString(" " , " \n " , " \n " )
92
+ val checkFile = java.nio.file.Paths .get(" tests/run/" + testFileName.stripSuffix(" .scala" ) + " .check" )
93
+ if (java.nio.file.Files .exists(checkFile)) {
94
+ val expectedOutput = Source .fromFile(checkFile.toFile).getLines().mkString(" " , " \n " , " \n " )
81
95
82
- assert(expectedOutput == actualOutput,
83
- " \n >>>>>>>>>>>>>>>>>>\n " +
84
- DiffUtil .mkColoredCodeDiff(actualOutput, expectedOutput, true ) +
85
- " <<<<<<<<<<<<<<<<<<"
86
- )
96
+ assert(expectedOutput == actualOutput,
97
+ " \n >>>>>>>>>>>>>>>>>>\n " +
98
+ DiffUtil .mkColoredCodeDiff(actualOutput, expectedOutput, true ) +
99
+ " <<<<<<<<<<<<<<<<<<"
100
+ )
101
+ }
87
102
}
88
103
89
104
def interpret (classpath : String * )(interpretedClasses : String * ): String = {
0 commit comments