From 534ced4885e75d89025d569cc2cbc2da8ed45cab Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Mon, 2 Sep 2013 07:56:03 -0700 Subject: SI-7781 Improve test and add comment The test should normalize the elided message, not strip it. (Thanks qerub; I was frustrated with kitteh's turnaround that night, hence unwilling to improve once it passed.) --- test/files/run/repl-trim-stack-trace.scala | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test/files/run') diff --git a/test/files/run/repl-trim-stack-trace.scala b/test/files/run/repl-trim-stack-trace.scala index db42b37fdd..0f4a43bc85 100644 --- a/test/files/run/repl-trim-stack-trace.scala +++ b/test/files/run/repl-trim-stack-trace.scala @@ -33,9 +33,12 @@ java.lang.Exception scala> """ - // remove the "elided" lines because the frame count is variable - lazy val elided = """\s+\.{3} (?:\d+) elided""".r - def filtered(lines: Seq[String]) = lines filter { case elided() => false ; case _ => true } - override def eval() = filtered(super.eval().toSeq).iterator - override def expected = filtered(super.expected).toList + // normalize the "elided" lines because the frame count depends on test context + lazy val elided = """(\s+\.{3} )\d+( elided)""".r + def normalize(line: String) = line match { + case elided(ellipsis, suffix) => s"$ellipsis???$suffix" + case s => s + } + override def eval() = super.eval() map normalize + override def expected = super.expected map normalize } -- cgit v1.2.3