2011-03-16 20:40:51 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
|
|
|
use std;
|
2011-05-17 13:41:41 -05:00
|
|
|
import std::str;
|
2011-03-16 20:40:51 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
auto s = "hello";
|
2011-05-23 21:22:08 -05:00
|
|
|
auto sb = str::buf(s);
|
|
|
|
auto s_cstr = str::str_from_cstr(sb);
|
|
|
|
assert (str::eq(s_cstr, s));
|
|
|
|
auto s_buf = str::str_from_buf(sb, 5u);
|
|
|
|
assert (str::eq(s_buf, s));
|
2011-03-16 20:40:51 -05:00
|
|
|
}
|
|
|
|
|