From ad502b350fecca7a23b46dea300e2a543a248f97 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Tue, 21 Apr 2015 17:10:50 -0700 Subject: SI-9275 Fix row-first display in REPL A missing range check in case anyone ever wants to use ``` -Dscala.repl.format=across ``` which was observed only because of competition from Ammonite. --- .../scala/tools/nsc/interpreter/TabulatorTest.scala | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') diff --git a/test/junit/scala/tools/nsc/interpreter/TabulatorTest.scala b/test/junit/scala/tools/nsc/interpreter/TabulatorTest.scala index 21e338eac0..263265026a 100644 --- a/test/junit/scala/tools/nsc/interpreter/TabulatorTest.scala +++ b/test/junit/scala/tools/nsc/interpreter/TabulatorTest.scala @@ -82,4 +82,24 @@ class TabulatorTest { assert(rows(0).size == 1) assert(rows(0)(0).size == "efg".length + sut.marginSize) // 6 } + @Test def badFit() = { + val sut = VTabby(isAcross = true) + val items = ('a' until 'z').map(_.toString).toList + val rows = sut tabulate items + assert(rows.size == 2) + assert(rows(0).size == 20) // 20 * 4 = 80 + assert(rows(1)(0).dropRight(sut.marginSize) == "u") + } + @Test def badFitter() = { + val sut = VTabby(isAcross = true) + val items = List ( + "%", "&", "*", "+", "-", "/", ">", ">=", ">>", ">>>", "^", + "asInstanceOf", "isInstanceOf", "toByte", "toChar", "toDouble", "toFloat", + "toInt", "toLong", "toShort", "toString", "unary_+", "unary_-", "unary_~", "|" + ) + val rows = sut tabulate items + assert(rows.size == 4) + assert(rows(3).size == 4) // 7 cols + assert(rows(3)(0).dropRight(sut.marginSize) == "unary_+") + } } -- cgit v1.2.3