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;
|
2011-05-06 22:13:13 +02:00
|
|
|
import std.Str;
|
2011-03-16 18:40:51 -07:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
auto s = "hello";
|
2011-05-06 22:13:13 +02: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 18:40:51 -07:00
|
|
|
}
|
|
|
|
|