2011-04-11 21:36:10 -04:00
|
|
|
// xfail-boot
|
2011-03-25 12:19:20 -07:00
|
|
|
// xfail-stage0
|
2011-02-27 14:30:44 -05:00
|
|
|
use std;
|
|
|
|
import std._str;
|
2011-02-23 23:48:01 -05:00
|
|
|
|
|
|
|
fn test(str actual, str expected) {
|
|
|
|
log actual;
|
|
|
|
log expected;
|
2011-02-27 14:30:44 -05:00
|
|
|
check (_str.eq(actual, expected));
|
2011-02-23 23:48:01 -05:00
|
|
|
}
|
|
|
|
|
2010-10-01 14:54:40 -07:00
|
|
|
fn main() {
|
2011-02-27 14:30:44 -05:00
|
|
|
test(#fmt("hello %d friends and %s things", 10, "formatted"),
|
|
|
|
"hello 10 friends and formatted things");
|
2011-04-11 21:36:10 -04:00
|
|
|
|
|
|
|
// Simple tests for types
|
|
|
|
test(#fmt("%d", 1), "1");
|
|
|
|
test(#fmt("%i", 2), "2");
|
|
|
|
test(#fmt("%i", -1), "-1");
|
2011-04-11 23:39:13 -04:00
|
|
|
test(#fmt("%u", 10u), "10");
|
2011-04-11 21:36:10 -04:00
|
|
|
test(#fmt("%s", "test"), "test");
|
|
|
|
test(#fmt("%b", true), "true");
|
|
|
|
test(#fmt("%b", false), "false");
|
|
|
|
test(#fmt("%c", 'A'), "A");
|
2010-10-01 14:54:40 -07:00
|
|
|
}
|