]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / log-knows-the-names-of-variants-in-std.rs
index 165561e5256ecad138198682ef4e26a55bb1bee2..c4b45ae0f0e62cf49b3db6293516414483aa1725 100644 (file)
@@ -8,26 +8,26 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[deriving(Clone, Show)]
+#[derive(Clone, Debug)]
 enum foo {
   a(uint),
   b(String),
 }
 
-fn check_log<T: std::fmt::Show>(exp: String, v: T) {
-    assert_eq!(exp, format!("{}", v));
+fn check_log<T: std::fmt::Debug>(exp: String, v: T) {
+    assert_eq!(exp, format!("{:?}", v));
 }
 
 pub fn main() {
-    let mut x = Some(foo::a(22u));
+    let mut x = Some(foo::a(22));
     let exp = "Some(a(22))".to_string();
-    let act = format!("{}", x);
+    let act = format!("{:?}", x);
     assert_eq!(act, exp);
     check_log(exp, x);
 
     x = None;
     let exp = "None".to_string();
-    let act = format!("{}", x);
+    let act = format!("{:?}", x);
     assert_eq!(act, exp);
     check_log(exp, x);
 }