aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Frostig <[email protected]>2010-09-20 17:42:14 -0700
committerRoy Frostig <[email protected]>2010-09-20 17:42:14 -0700
commitdda16f807c2b1ce7d2ee6e510bee75e6a8dea30c (patch)
treee9c990ce8b633bbea9a2d0c04cb9df3aba4c1b06
parentWhen translating vec-append, delay destination string's null-byte-accounting ... (diff)
downloadrust-dda16f807c2b1ce7d2ee6e510bee75e6a8dea30c.tar.xz
rust-dda16f807c2b1ce7d2ee6e510bee75e6a8dea30c.zip
Add issue #163 testcase to str-append testcase.
-rw-r--r--src/test/run-pass/str-append.rs24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/test/run-pass/str-append.rs b/src/test/run-pass/str-append.rs
index 1bd05215..da4ca07f 100644
--- a/src/test/run-pass/str-append.rs
+++ b/src/test/run-pass/str-append.rs
@@ -1,8 +1,30 @@
// -*- rust -*-
-fn main() {
+use std;
+import std._str;
+
+fn test1() {
let str s = "hello";
s += "world";
log s;
check(s.(9) == ('d' as u8));
}
+
+fn test2() {
+ // This tests for issue #163
+
+ let str ff = "abc";
+ let str a = ff + "ABC" + ff;
+ let str b = "ABC" + ff + "ABC";
+
+ log a;
+ log b;
+
+ check (_str.eq(a, "abcABCabc"));
+ check (_str.eq(b, "ABCabcABC"));
+}
+
+fn main() {
+ test1();
+ test2();
+}