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