2011-03-25 14:19:20 -05:00
|
|
|
// xfail-stage0
|
2011-05-03 20:13:51 -05:00
|
|
|
// xfail-stage1
|
|
|
|
// xfail-stage2
|
2011-03-16 20:40:51 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
|
|
|
use std;
|
2011-05-12 10:24:54 -05:00
|
|
|
import std::_str;
|
2011-03-16 20:40:51 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
auto s = "hello";
|
2011-05-12 10:24:54 -05:00
|
|
|
auto sb = str.rustrt.str_buf(s);
|
|
|
|
auto s_cstr = str.rustrt.str_from_cstr(sb);
|
|
|
|
assert (str.eq(s_cstr, s));
|
|
|
|
auto s_buf = str.rustrt.str_from_buf(sb, 5u);
|
|
|
|
assert (str.eq(s_buf, s));
|
2011-03-16 20:40:51 -05:00
|
|
|
}
|
|
|
|
|