diff options
author | Som Snytt <som.snytt@gmail.com> | 2015-04-21 17:10:50 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2015-04-21 17:10:50 -0700 |
commit | ad502b350fecca7a23b46dea300e2a543a248f97 (patch) | |
tree | d897aeb7e2ff3cead5b1a0599452418478debcb8 /test/junit | |
parent | 906584d89cf5eb92b3859c5ae099b54b280208bc (diff) | |
download | scala-ad502b350fecca7a23b46dea300e2a543a248f97.tar.gz scala-ad502b350fecca7a23b46dea300e2a543a248f97.tar.bz2 scala-ad502b350fecca7a23b46dea300e2a543a248f97.zip |
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.
Diffstat (limited to 'test/junit')
-rw-r--r-- | test/junit/scala/tools/nsc/interpreter/TabulatorTest.scala | 20 |
1 files changed, 20 insertions, 0 deletions
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_+") + } } |