rust/src/test/run-pass/lib-str-buf.rs

15 lines
259 B
Rust
Raw Normal View History

// -*- rust -*-
use std;
import std::str;
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));
}