Skip to content

Commit bd12473

Browse files
committed
Force tests to not use the fallback and fix the result
1 parent d754d25 commit bd12473

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

repl/test-resources/repl/i7644

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ scala> class T extends CanEqual
1313
| Cannot extend sealed trait CanEqual in a different source file
1414
|
1515
| longer explanation available when compiling with `-explain`
16+
2 warnings found
1617
1 error found
17-

repl/test/dotty/tools/repl/ReplTest.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ extends ReplDriver(options, new PrintStream(out, true, StandardCharsets.UTF_8.na
100100
out.linesIterator.foreach(buf.append)
101101
nstate
102102
}
103-
(optsLine :: buf.toList).filter(nonBlank)
103+
// We run the repl with `-Ydebug` to not use the fallback if there's a class load exception so we can notice these,
104+
// but as a consequence we get debug messages; ignore the stale symbol one, whose contents include symbol IDs
105+
// that depend on the exact compiler.
106+
(optsLine :: buf.toList).filter(nonBlank).filter(!_.startsWith("stale symbol;"))
104107
}
105108

106109
if FileDiff.matches(actualOutput, expectedOutput) then None
@@ -120,6 +123,6 @@ extends ReplDriver(options, new PrintStream(out, true, StandardCharsets.UTF_8.na
120123
}
121124

122125
object ReplTest:
123-
val commonOptions = Array("-color:never", "-pagewidth", "80" /* TODO: but a lot of tests need fixing to match production behavior "-Ydebug"*/)
126+
val commonOptions = Array("-color:never", "-pagewidth", "80", "-Ydebug")
124127
val defaultOptions = commonOptions ++ Array("-classpath", TestConfiguration.replClassPath)
125128
lazy val withStagingOptions = commonOptions ++ Array("-classpath", TestConfiguration.replWithStagingClasspath)

repl/test/dotty/tools/repl/ShadowingTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import vulpix.{TestConfiguration, TestFlags}
2525
* and running scripted REPL tests with them on the claspath.
2626
*/
2727
object ShadowingTests:
28-
def classpath = TestConfiguration.basicClasspath + File.pathSeparator + shadowDir
28+
def classpath = TestConfiguration.replClassPath + File.pathSeparator + shadowDir
2929
def options = ReplTest.commonOptions ++ Array("-classpath", classpath)
3030
def shadowDir = dir.toAbsolutePath.toString
3131

0 commit comments

Comments
 (0)