@@ -2,7 +2,7 @@ package dotty.tools
22package repl
33
44import org .junit .Assert ._
5- import org .junit .Test
5+ import org .junit .{ Test , Ignore }
66
77import dotc .core .Contexts .Context
88import dotc .ast .Trees ._
@@ -93,26 +93,31 @@ class ReplCompilerTests extends ReplTest {
9393 )
9494 }
9595
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 = {
9798 fromInitialState { implicit s =>
9899 compile(" null.toString" )
99- storedOutput().startsWith(" java.lang.NullPointerException" )
100+ assertTrue( storedOutput().startsWith(" java.lang.NullPointerException" ) )
100101 }
101102
102103 fromInitialState { implicit s =>
103104 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" ) )
105106 }
106107
107108 fromInitialState { implicit s =>
108109 compile(""" throw new IllegalArgumentException("Hello")""" )
109- storedOutput().startsWith(" java.lang.IllegalArgumentException: Hello" )
110+ assertTrue( storedOutput().startsWith(" java.lang.IllegalArgumentException: Hello" ) )
110111 }
111112
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 =" ))
117122 }
118123}
0 commit comments