Skip to content

Commit dda16f8

Browse files
committed
Add issue rust-lang#163 testcase to str-append testcase.
1 parent 3c3421e commit dda16f8

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/test/run-pass/str-append.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
// -*- rust -*-
22

3-
fn main() {
3+
use std;
4+
import std._str;
5+
6+
fn test1() {
47
let str s = "hello";
58
s += "world";
69
log s;
710
check(s.(9) == ('d' as u8));
811
}
12+
13+
fn test2() {
14+
// This tests for issue #163
15+
16+
let str ff = "abc";
17+
let str a = ff + "ABC" + ff;
18+
let str b = "ABC" + ff + "ABC";
19+
20+
log a;
21+
log b;
22+
23+
check (_str.eq(a, "abcABCabc"));
24+
check (_str.eq(b, "ABCabcABC"));
25+
}
26+
27+
fn main() {
28+
test1();
29+
test2();
30+
}

0 commit comments

Comments
 (0)