summaryrefslogtreecommitdiff
path: root/test/files/run/repl-javap-app.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2016-04-07 12:32:40 -0700
committerSom Snytt <som.snytt@gmail.com>2016-05-02 10:36:43 -0700
commit86ae2f95ce33ef22f9c9ad40d6a966fbef7d352f (patch)
tree848f206dcd7b7f6461cec183aef136e8ead30b57 /test/files/run/repl-javap-app.scala
parentcf3850626a62ce7aefad129b3af5c8184c7226a6 (diff)
downloadscala-86ae2f95ce33ef22f9c9ad40d6a966fbef7d352f.tar.gz
scala-86ae2f95ce33ef22f9c9ad40d6a966fbef7d352f.tar.bz2
scala-86ae2f95ce33ef22f9c9ad40d6a966fbef7d352f.zip
SI-9740 Repl import fix -Yrepl-class-based
Under `-Yrepl-class-based`, templating must follow the same scoping as under traditional object-based. The new test shows a typical case where two values of the same simple name must be imported in different scopes.
Diffstat (limited to 'test/files/run/repl-javap-app.scala')
-rw-r--r--test/files/run/repl-javap-app.scala15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/files/run/repl-javap-app.scala b/test/files/run/repl-javap-app.scala
index ad6076c2d5..f7e3baa2a1 100644
--- a/test/files/run/repl-javap-app.scala
+++ b/test/files/run/repl-javap-app.scala
@@ -8,14 +8,11 @@ object MyApp extends App {
object Test extends ReplTest {
def code = ":javap -app MyApp$"
- override def welcoming = true
-
- // The constant pool indices are not the same for GenASM / GenBCode, so
- // replacing the exact numbers by XX.
- lazy val hasConstantPoolRef = """(.*)(#\d\d)(.*)""".r
-
- override def normalize(s: String) = s match {
- case hasConstantPoolRef(start, ref, end) => start + "#XX" + end
- case _ => super.normalize(s)
+ override def show() = {
+ val coded = "Code:"
+ val strung = "String Hello, delayed world."
+ val lines = eval().toList
+ assert (lines.count(s => s.endsWith(coded)) == 1)
+ assert (lines.count(s => s.endsWith(strung)) == 1)
}
}