diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-04-22 17:25:04 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-04-22 17:25:04 -0700 |
commit | 8f99b5819449c01d89a918069029f7898c56e35a (patch) | |
tree | 11524149398cde62605c80a012c61e7ab3b5bbaf /test | |
parent | 540b18fb68a0210b187e595622c31f20b2c6f581 (diff) | |
parent | ad502b350fecca7a23b46dea300e2a543a248f97 (diff) | |
download | scala-8f99b5819449c01d89a918069029f7898c56e35a.tar.gz scala-8f99b5819449c01d89a918069029f7898c56e35a.tar.bz2 scala-8f99b5819449c01d89a918069029f7898c56e35a.zip |
Merge pull request #4462 from som-snytt/issue/badtab
SI-9275 Fix row-first display in REPL
Diffstat (limited to 'test')
-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_+") + } } |