diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-05-24 14:05:24 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-05-25 13:40:43 +0200 |
commit | 460e10cdb2fdfb9becaed5590ec77c7d5324a4db (patch) | |
tree | ec1ec551628bac91f17c6354b0504709f7721ff5 /test/junit | |
parent | 53a274e3f1258bd7d26a72d4394108b2f4d04579 (diff) | |
download | scala-460e10cdb2fdfb9becaed5590ec77c7d5324a4db.tar.gz scala-460e10cdb2fdfb9becaed5590ec77c7d5324a4db.tar.bz2 scala-460e10cdb2fdfb9becaed5590ec77c7d5324a4db.zip |
Address review feedback
Address feedback in #4516 / 57b8da4cd8. Save allocations of
NullnessValue - there's only 4 possible instances. Also save tuple
allocations in InstructionStackEffect.
Diffstat (limited to 'test/junit')
-rw-r--r-- | test/junit/scala/tools/nsc/backend/jvm/analysis/NullnessAnalyzerTest.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/junit/scala/tools/nsc/backend/jvm/analysis/NullnessAnalyzerTest.scala b/test/junit/scala/tools/nsc/backend/jvm/analysis/NullnessAnalyzerTest.scala index 92574329db..3d5343e395 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/analysis/NullnessAnalyzerTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/analysis/NullnessAnalyzerTest.scala @@ -63,9 +63,9 @@ class NullnessAnalyzerTest extends ClearAfterClass { val f = analyzer.frameAt(i, method) val frameString = { if (f == null) "null" - else f.toString.split("NullnessValue").iterator - .map(_.trim).filter(_.nonEmpty) - .map(s => "%7s".format(s.replaceAll("""\((.*),false\)""", "$1"))) + else (0 until (f.getLocals + f.getStackSize)).iterator + .map(f.getValue(_).toString) + .map(s => "%8s".format(s)) .zipWithIndex.map({case (s, i) => s"$i: $s"}) .mkString(", ") } @@ -82,13 +82,13 @@ class NullnessAnalyzerTest extends ClearAfterClass { // So in the frame for `ALOAD 0`, the stack is still empty. val res = - """ L0: 0: NotNull - | LINENUMBER 1 L0: 0: NotNull - | ALOAD 0: 0: NotNull - |INVOKEVIRTUAL java/lang/Object.toString ()Ljava/lang/String;: 0: NotNull, 1: NotNull - | ARETURN: 0: NotNull, 1: Unknown + """ L0: 0: NotNull + | LINENUMBER 1 L0: 0: NotNull + | ALOAD 0: 0: NotNull + |INVOKEVIRTUAL java/lang/Object.toString ()Ljava/lang/String;: 0: NotNull, 1: NotNull + | ARETURN: 0: NotNull, 1: Unknown1 | L0: null""".stripMargin - assertTrue(showAllNullnessFrames(newNullnessAnalyzer(m), m) == res) + assertEquals(showAllNullnessFrames(newNullnessAnalyzer(m), m), res) } @Test |