mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-12 18:07:40 +00:00
Add issue #163 testcase to str-append testcase.
This commit is contained in:
parent
3c3421e01d
commit
dda16f807c
@ -1,8 +1,30 @@
|
|||||||
// -*- rust -*-
|
// -*- rust -*-
|
||||||
|
|
||||||
fn main() {
|
use std;
|
||||||
|
import std._str;
|
||||||
|
|
||||||
|
fn test1() {
|
||||||
let str s = "hello";
|
let str s = "hello";
|
||||||
s += "world";
|
s += "world";
|
||||||
log s;
|
log s;
|
||||||
check(s.(9) == ('d' as u8));
|
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();
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user