summaryrefslogtreecommitdiff
path: root/test/pending
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-04-24 07:01:47 +0000
committerPaul Phillips <paulp@improving.org>2010-04-24 07:01:47 +0000
commitee1042f8c6f9981833176acd3fbdb8782f175888 (patch)
tree6d9adc517403749140b3f27ab4086ec2a98f0569 /test/pending
parenta0e5e165c97c01cf0854aeda72e4e9d1d037bb8c (diff)
downloadscala-ee1042f8c6f9981833176acd3fbdb8782f175888.tar.gz
scala-ee1042f8c6f9981833176acd3fbdb8782f175888.tar.bz2
scala-ee1042f8c6f9981833176acd3fbdb8782f175888.zip
StringBuilder no longer violates the Seq revers...
StringBuilder no longer violates the Seq reverse contract: it returns a new StringBuilder. The behavior formerly found in reverse (updates in place) is now available in reverseContents. Migration warning on reverse. Closes #3327. Also did some StringBuilder rewriting as per discussion with odersky. And took a cleaver to parts of the documentation to get to the good parts a little faster. Review by community.
Diffstat (limited to 'test/pending')
-rw-r--r--test/pending/run/string-reverse.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/pending/run/string-reverse.scala b/test/pending/run/string-reverse.scala
new file mode 100644
index 0000000000..51b16bcd6a
--- /dev/null
+++ b/test/pending/run/string-reverse.scala
@@ -0,0 +1,22 @@
+/** In case we ever feel like taking on unicode string reversal.
+ * See ticket #2565.
+ */
+object Test {
+ val xs = "Les Mise\u0301rables" // this is the tricky one to reverse
+ val ys = "Les Misérables"
+ val xs2 = new StringBuilder(xs)
+ val ys2 = new StringBuilder(ys)
+
+ def main(args: Array[String]): Unit = {
+ val out = new java.io.PrintStream(System.out, true, "UTF-8")
+
+ out.println("Strings")
+ List(xs, xs.reverse, ys, ys.reverse) foreach (out println _)
+
+ out.println("StringBuilder")
+ out.println(xs2.toString)
+ out.println(xs2.reverseContents().toString)
+ out.println(ys2.toString)
+ out.println(ys2.reverseContents().toString)
+ }
+} \ No newline at end of file