2011-04-28 22:16:32 -05:00
|
|
|
fn main() {
|
|
|
|
auto s = "a";
|
|
|
|
s += "b";
|
2011-05-02 19:47:24 -05:00
|
|
|
assert (s.(0) == ('a' as u8));
|
|
|
|
assert (s.(1) == ('b' as u8));
|
2011-04-28 22:16:32 -05:00
|
|
|
|
|
|
|
s += "c";
|
|
|
|
s += "d";
|
2011-05-02 19:47:24 -05:00
|
|
|
assert (s.(0) == ('a' as u8));
|
|
|
|
assert (s.(1) == ('b' as u8));
|
|
|
|
assert (s.(2) == ('c' as u8));
|
|
|
|
assert (s.(3) == ('d' as u8));
|
2011-04-28 22:16:32 -05:00
|
|
|
}
|
|
|
|
|