diff --git a/src/libcore/repr.rs b/src/libcore/repr.rs index 350cdeb1c399..4d4970eada80 100644 --- a/src/libcore/repr.rs +++ b/src/libcore/repr.rs @@ -569,6 +569,9 @@ pub fn write_repr(writer: @Writer, object: &T) { } } +#[test] +struct P {a: int, b: float} + #[test] fn test_repr() { @@ -609,11 +612,11 @@ fn test_repr() { "~[\"hi\", \"there\"]"); exact_test(&(&["hi", "there"]), "&[\"hi\", \"there\"]"); - exact_test(&({a:10, b:1.234}), + exact_test(&(P{a:10, b:1.234}), "{a: 10, b: 1.2340}"); - exact_test(&(@{a:10, b:1.234}), + exact_test(&(@P{a:10, b:1.234}), "@{a: 10, b: 1.2340}"); - exact_test(&(~{a:10, b:1.234}), + exact_test(&(~P{a:10, b:1.234}), "~{a: 10, b: 1.2340}"); exact_test(&(10_u8, ~"hello"), "(10, ~\"hello\")");