summaryrefslogtreecommitdiff
path: root/test/junit
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-12-03 16:38:55 -0800
committerSom Snytt <som.snytt@gmail.com>2013-12-03 16:56:18 -0800
commit30f779b4d9b699800e323eeba31cf04c16b4fbcd (patch)
tree128e704dd783731294062b76c832abb17c0c778d /test/junit
parent6c63ab153651f7946ece5740d52e0f2b701e349d (diff)
downloadscala-30f779b4d9b699800e323eeba31cf04c16b4fbcd.tar.gz
scala-30f779b4d9b699800e323eeba31cf04c16b4fbcd.tar.bz2
scala-30f779b4d9b699800e323eeba31cf04c16b4fbcd.zip
SI-8027 REPL double tab regression
Where did double tab go? "The shadow knows." The regression was introduced by the last flurry before we were left to wallow in whatever white space remained. Some xs put other xs under erasure. It's clear that somebody's daughter walked into the room and asked for a story, because, shockingly, the case arrows don't line up. We need a plug-in for Jenkins, or I guess Travis, to fail the build if arrows and equals don't align, because it clearly indicates a lapse of some kind.
Diffstat (limited to 'test/junit')
-rw-r--r--test/junit/scala/reflect/internal/util/StringOpsTest.scala52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/junit/scala/reflect/internal/util/StringOpsTest.scala b/test/junit/scala/reflect/internal/util/StringOpsTest.scala
new file mode 100644
index 0000000000..13d3a6435e
--- /dev/null
+++ b/test/junit/scala/reflect/internal/util/StringOpsTest.scala
@@ -0,0 +1,52 @@
+package scala.reflect.internal.util
+
+import org.junit.Assert._
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(classOf[JUnit4])
+class StringOpsTest {
+ @Test
+ def prefixOfNone(): Unit = {
+ val so = new StringOps { }
+ val ss = Nil
+ val lcp = so longestCommonPrefix ss
+ assert(lcp == "")
+ }
+ @Test
+ def prefixWithEmpty(): Unit = {
+ val so = new StringOps { }
+ val ss = List("abc", "", "abd")
+ val lcp = so longestCommonPrefix ss
+ assert(lcp == "")
+ }
+ @Test
+ def prefixOfOne(): Unit = {
+ val so = new StringOps { }
+ val ss = List("abc")
+ val lcp = so longestCommonPrefix ss
+ assert(lcp == "abc")
+ }
+ @Test
+ def prefixOfMany(): Unit = {
+ val so = new StringOps { }
+ val ss = List("abc", "abd", "abe")
+ val lcp = so longestCommonPrefix ss
+ assert(lcp == "ab")
+ }
+ @Test
+ def prefixOfPrefix(): Unit = {
+ val so = new StringOps { }
+ val ss = List("abc", "abcd")
+ val lcp = so longestCommonPrefix ss
+ assert(lcp == "abc")
+ }
+ @Test
+ def prefixOfPrefixMiddling(): Unit = {
+ val so = new StringOps { }
+ val ss = List("abce", "abc", "abcd")
+ val lcp = so longestCommonPrefix ss
+ assert(lcp == "abc")
+ }
+}