Skip to content

Commit 4098c43

Browse files
nicolasstuckibiboudis
authored andcommitted
Add a list of interesting tests
1 parent 085e1dd commit 4098c43

File tree

1 file changed

+27
-12
lines changed
  • tests/run-with-compiler-custom-args/tasty-interpreter

1 file changed

+27
-12
lines changed

tests/run-with-compiler-custom-args/tasty-interpreter/Test.scala

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,30 +60,45 @@ object Test {
6060
"<<<<<<<<<<<<<<<<<<"
6161
)
6262

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")
6679
}
6780

68-
def compileAndInterpret(testName: String) = {
81+
def compileAndInterpret(testFileName: String) = {
6982
val reproter = new Reporter {
7083
def doReport(m: MessageContainer)(implicit ctx: Contexts.Context): Unit = println(m)
7184
}
7285
val out = java.nio.file.Paths.get("out/interpreted")
7386
if (!java.nio.file.Files.exists(out))
7487
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)
7689

7790
val actualOutput = interpret(out.toString)("Test")
7891

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")
8195

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+
}
87102
}
88103

89104
def interpret(classpath: String*)(interpretedClasses: String*): String = {

0 commit comments

Comments
 (0)