@@ -2,7 +2,7 @@ package dotty.tools
2
2
package repl
3
3
4
4
import org .junit .Assert ._
5
- import org .junit .Test
5
+ import org .junit .{ Test , Ignore }
6
6
7
7
import dotc .core .Contexts .Context
8
8
import dotc .ast .Trees ._
@@ -93,26 +93,31 @@ class ReplCompilerTests extends ReplTest {
93
93
)
94
94
}
95
95
96
- @ Test def i3305 : Unit = {
96
+ // FIXME: Tests are not run in isolation, the classloader is corrupted after the first exception
97
+ @ Ignore def i3305 : Unit = {
97
98
fromInitialState { implicit s =>
98
99
compile(" null.toString" )
99
- storedOutput().startsWith(" java.lang.NullPointerException" )
100
+ assertTrue( storedOutput().startsWith(" java.lang.NullPointerException" ) )
100
101
}
101
102
102
103
fromInitialState { implicit s =>
103
104
compile(" def foo: Int = 1 + foo; foo" )
104
- storedOutput().startsWith(" def foo: Int\n java.lang.StackOverflowError" )
105
+ assertTrue( storedOutput().startsWith(" def foo: Int\n java.lang.StackOverflowError" ) )
105
106
}
106
107
107
108
fromInitialState { implicit s =>
108
109
compile(""" throw new IllegalArgumentException("Hello")""" )
109
- storedOutput().startsWith(" java.lang.IllegalArgumentException: Hello" )
110
+ assertTrue( storedOutput().startsWith(" java.lang.IllegalArgumentException: Hello" ) )
110
111
}
111
112
112
- // FIXME
113
- // fromInitialState { implicit s =>
114
- // compile("val (x, y) = null")
115
- // storedOutput().startsWith("scala.MatchError: null")
116
- // }
113
+ fromInitialState { implicit s =>
114
+ compile(" val (x, y) = null" )
115
+ assertTrue(storedOutput().startsWith(" scala.MatchError: null" ))
116
+ }
117
+ }
118
+
119
+ @ Test def i2789 : Unit = fromInitialState { implicit state =>
120
+ compile(" (x: Int) => println(x)" )
121
+ assertTrue(storedOutput().startsWith(" val res0: Int => Unit =" ))
117
122
}
118
123
}
0 commit comments