// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(macro_rules)]
-
use std::mem::size_of;
-#[deriving(PartialEq, Show)]
+#[derive(PartialEq, Debug)]
enum Either<T, U> { Left(T), Right(U) }
macro_rules! check {
static S: $t = $e;
let v: $t = $e;
assert_eq!(S, v);
- assert_eq!(format!("{}", v).as_slice(), $s);
- assert_eq!(format!("{}", S).as_slice(), $s);
+ assert_eq!(format!("{:?}", v).as_slice(), $s);
+ assert_eq!(format!("{:?}", S).as_slice(), $s);
});*
}}
}
None, "None",
Some(-20000i16), "Some(-20000)");
check!(Either<u8, i8>, 2,
- Left(132u8), "Left(132)",
- Right(-32i8), "Right(-32)");
+ Either::Left(132u8), "Left(132)",
+ Either::Right(-32i8), "Right(-32)");
check!(Either<u8, i16>, 4,
- Left(132u8), "Left(132)",
- Right(-20000i16), "Right(-20000)");
+ Either::Left(132u8), "Left(132)",
+ Either::Right(-20000i16), "Right(-20000)");
}