rust/src/test/run-pass/log-knows-the-names-of-variants.rs

17 lines
240 B
Rust

enum foo {
a(uint),
b(~str),
c,
}
enum bar {
d, e, f
}
fn main() {
assert ~"a(22)" == fmt!("%?", a(22u));
assert ~"b(~\"hi\")" == fmt!("%?", b(~"hi"));
assert ~"c" == fmt!("%?", c);
assert ~"d" == fmt!("%?", d);
}