rust/src/test/run-pass/syntax-extension-fmt.rs

17 lines
367 B
Rust
Raw Normal View History

use std;
import std._str;
2011-02-23 23:48:01 -05:00
fn test(str actual, str expected) {
log actual;
log expected;
check (_str.eq(actual, expected));
2011-02-23 23:48:01 -05:00
}
fn main() {
test(#fmt("hello %d friends and %s things", 10, "formatted"),
"hello 10 friends and formatted things");
2011-02-27 22:18:27 -05:00
test(#fmt("d: %d", 1), "d: 1");
test(#fmt("i: %i", 2), "i: 2");
test(#fmt("s: %s", "test"), "s: test");
}