diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-02-28 01:23:06 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-28 23:01:54 -0800 |
| commit | 02882fbd7edcb8d0d152afcdc8571216efcbd664 (patch) | |
| tree | ab893c74b3fdd3d58394e8dd9d74561adfe3326b /src/test | |
| parent | 123eb4ebea695f724a2375a73db53b91273e5ce0 (diff) | |
| download | rust-02882fbd7edcb8d0d152afcdc8571216efcbd664.tar.gz rust-02882fbd7edcb8d0d152afcdc8571216efcbd664.zip | |
std: Change assert_eq!() to use {} instead of {:?}
Formatting via reflection has been a little questionable for some time now, and
it's a little unfortunate that one of the standard macros will silently use
reflection when you weren't expecting it. This adds small bits of code bloat to
libraries, as well as not always being necessary. In light of this information,
this commit switches assert_eq!() to using {} in the error message instead of
{:?}.
In updating existing code, there were a few error cases that I encountered:
* It's impossible to define Show for [T, ..N]. I think DST will alleviate this
because we can define Show for [T].
* A few types here and there just needed a #[deriving(Show)]
* Type parameters needed a Show bound, I often moved this to `assert!(a == b)`
* `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths.
I don't think this is much of a regression though because {:?} on paths looks
awful (it's a byte array).
Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime
significant for smaller binaries.
Diffstat (limited to 'src/test')
44 files changed, 64 insertions, 44 deletions
diff --git a/src/test/auxiliary/trait_inheritance_overloading_xc.rs b/src/test/auxiliary/trait_inheritance_overloading_xc.rs index 8694871417a..6c98cd11169 100644 --- a/src/test/auxiliary/trait_inheritance_overloading_xc.rs +++ b/src/test/auxiliary/trait_inheritance_overloading_xc.rs @@ -13,6 +13,7 @@ use std::cmp::Eq; pub trait MyNum : Add<Self,Self> + Sub<Self,Self> + Mul<Self,Self> + Eq { } +#[deriving(Show)] pub struct MyInt { val: int } diff --git a/src/test/run-pass/assert-eq-macro-success.rs b/src/test/run-pass/assert-eq-macro-success.rs index 047c339fafb..f7389f65067 100644 --- a/src/test/run-pass/assert-eq-macro-success.rs +++ b/src/test/run-pass/assert-eq-macro-success.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[deriving(Eq)] +#[deriving(Eq, Show)] struct Point { x : int } pub fn main() { diff --git a/src/test/run-pass/binops.rs b/src/test/run-pass/binops.rs index 2fe39dc624c..233509a8cd2 100644 --- a/src/test/run-pass/binops.rs +++ b/src/test/run-pass/binops.rs @@ -63,7 +63,7 @@ fn test_ptr() { } } -#[deriving(Eq)] +#[deriving(Eq, Show)] struct p { x: int, y: int, diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index 14e27e683af..b9288a67f96 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -12,6 +12,7 @@ use std::cmp; +#[deriving(Show)] enum cat_type { tuxedo, tabby, tortoiseshell } impl cmp::Eq for cat_type { diff --git a/src/test/run-pass/coerce-to-closure-and-proc.rs b/src/test/run-pass/coerce-to-closure-and-proc.rs index 6f643ca0f41..075709b1c36 100644 --- a/src/test/run-pass/coerce-to-closure-and-proc.rs +++ b/src/test/run-pass/coerce-to-closure-and-proc.rs @@ -12,10 +12,10 @@ fn id<T>(x: T) -> T { x } -#[deriving(Eq)] +#[deriving(Eq, Show)] struct Foo<T>(T); -#[deriving(Eq)] +#[deriving(Eq, Show)] enum Bar<T> { Bar(T) } diff --git a/src/test/run-pass/const-cross-crate-extern.rs b/src/test/run-pass/const-cross-crate-extern.rs index 75a0bac0293..f5f6b599dc9 100644 --- a/src/test/run-pass/const-cross-crate-extern.rs +++ b/src/test/run-pass/const-cross-crate-extern.rs @@ -16,5 +16,5 @@ use cci_const::bar; static foo: extern "C" fn() = bar; pub fn main() { - assert_eq!(foo, bar); + assert!(foo == bar); } diff --git a/src/test/run-pass/const-extern-function.rs b/src/test/run-pass/const-extern-function.rs index 501a87955da..be7c47dafc0 100644 --- a/src/test/run-pass/const-extern-function.rs +++ b/src/test/run-pass/const-extern-function.rs @@ -18,6 +18,6 @@ struct S { } pub fn main() { - assert_eq!(foopy, f); - assert_eq!(f, s.f); + assert!(foopy == f); + assert!(f == s.f); } diff --git a/src/test/run-pass/const-struct.rs b/src/test/run-pass/const-struct.rs index af6dd4029f5..4508295b1cc 100644 --- a/src/test/run-pass/const-struct.rs +++ b/src/test/run-pass/const-struct.rs @@ -10,6 +10,7 @@ use std::cmp; +#[deriving(Show)] struct foo { a: int, b: int, c: int } impl cmp::Eq for foo { diff --git a/src/test/run-pass/deriving-primitive.rs b/src/test/run-pass/deriving-primitive.rs index bf63290a011..e90d7c803aa 100644 --- a/src/test/run-pass/deriving-primitive.rs +++ b/src/test/run-pass/deriving-primitive.rs @@ -11,7 +11,7 @@ use std::num::FromPrimitive; use std::int; -#[deriving(Eq, FromPrimitive)] +#[deriving(Eq, FromPrimitive, Show)] enum A { Foo = int::MAX, Bar = 1, diff --git a/src/test/run-pass/deriving-via-extension-c-enum.rs b/src/test/run-pass/deriving-via-extension-c-enum.rs index 3c4fb6c8c81..8fbff8f8f31 100644 --- a/src/test/run-pass/deriving-via-extension-c-enum.rs +++ b/src/test/run-pass/deriving-via-extension-c-enum.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[deriving(Eq)] +#[deriving(Eq, Show)] enum Foo { Bar, Baz, diff --git a/src/test/run-pass/deriving-via-extension-enum.rs b/src/test/run-pass/deriving-via-extension-enum.rs index b2974b4be0b..74d530b93ff 100644 --- a/src/test/run-pass/deriving-via-extension-enum.rs +++ b/src/test/run-pass/deriving-via-extension-enum.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[deriving(Eq)] +#[deriving(Eq, Show)] enum Foo { Bar(int, int), Baz(f64, f64) diff --git a/src/test/run-pass/deriving-via-extension-struct-empty.rs b/src/test/run-pass/deriving-via-extension-struct-empty.rs index 74698b9db28..f7c711e27d0 100644 --- a/src/test/run-pass/deriving-via-extension-struct-empty.rs +++ b/src/test/run-pass/deriving-via-extension-struct-empty.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[deriving(Eq)] +#[deriving(Eq, Show)] struct Foo; pub fn main() { diff --git a/src/test/run-pass/deriving-via-extension-struct-like-enum-variant.rs b/src/test/run-pass/deriving-via-extension-struct-like-enum-variant.rs index 38ecd6db63c..78768ca52b9 100644 --- a/src/test/run-pass/deriving-via-extension-struct-like-enum-variant.rs +++ b/src/test/run-pass/deriving-via-extension-struct-like-enum-variant.rs @@ -10,7 +10,7 @@ #[feature(struct_variant)]; -#[deriving(Eq)] +#[deriving(Eq, Show)] enum S { X { x: int, y: int }, Y diff --git a/src/test/run-pass/deriving-via-extension-struct-tuple.rs b/src/test/run-pass/deriving-via-extension-struct-tuple.rs index cc76751e27f..39c23914abc 100644 --- a/src/test/run-pass/deriving-via-extension-struct-tuple.rs +++ b/src/test/run-pass/deriving-via-extension-struct-tuple.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[deriving(Eq)] +#[deriving(Eq, Show)] struct Foo(int, int, ~str); pub fn main() { diff --git a/src/test/run-pass/deriving-via-extension-struct.rs b/src/test/run-pass/deriving-via-extension-struct.rs index 44aca59aa9c..db366231860 100644 --- a/src/test/run-pass/deriving-via-extension-struct.rs +++ b/src/test/run-pass/deriving-via-extension-struct.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[deriving(Eq)] +#[deriving(Eq, Show)] struct Foo { x: int, y: int, diff --git a/src/test/run-pass/deriving-via-extension-type-params.rs b/src/test/run-pass/deriving-via-extension-type-params.rs index 2ea558b566e..077d82ec6dc 100644 --- a/src/test/run-pass/deriving-via-extension-type-params.rs +++ b/src/test/run-pass/deriving-via-extension-type-params.rs @@ -10,7 +10,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[deriving(Eq, Hash)] +#[deriving(Eq, Hash, Show)] struct Foo<T> { x: int, y: T, diff --git a/src/test/run-pass/empty-tag.rs b/src/test/run-pass/empty-tag.rs index 7b9046318ab..b79de737ce0 100644 --- a/src/test/run-pass/empty-tag.rs +++ b/src/test/run-pass/empty-tag.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[deriving(Show)] enum chan { chan_t, } impl Eq for chan { diff --git a/src/test/run-pass/expr-if-struct.rs b/src/test/run-pass/expr-if-struct.rs index c40f2aa01c1..58e8a35fbfc 100644 --- a/src/test/run-pass/expr-if-struct.rs +++ b/src/test/run-pass/expr-if-struct.rs @@ -21,6 +21,7 @@ fn test_rec() { assert_eq!(rs.i, 100); } +#[deriving(Show)] enum mood { happy, sad, } impl Eq for mood { diff --git a/src/test/run-pass/expr-match-struct.rs b/src/test/run-pass/expr-match-struct.rs index 66ab591bb52..93f0575b5a0 100644 --- a/src/test/run-pass/expr-match-struct.rs +++ b/src/test/run-pass/expr-match-struct.rs @@ -20,6 +20,7 @@ fn test_rec() { assert_eq!(rs.i, 100); } +#[deriving(Show)] enum mood { happy, sad, } impl Eq for mood { diff --git a/src/test/run-pass/extern-compare-with-return-type.rs b/src/test/run-pass/extern-compare-with-return-type.rs index 53a5d3e9621..057394b2624 100644 --- a/src/test/run-pass/extern-compare-with-return-type.rs +++ b/src/test/run-pass/extern-compare-with-return-type.rs @@ -20,13 +20,13 @@ extern fn uintvoidret(_x: uint) {} extern fn uintuintuintuintret(x: uint, y: uint, z: uint) -> uint { x+y+z } pub fn main() { - assert_eq!(voidret1, voidret1); + assert!(voidret1 == voidret1); assert!(voidret1 != voidret2); - assert_eq!(uintret, uintret); + assert!(uintret == uintret); - assert_eq!(uintvoidret, uintvoidret); + assert!(uintvoidret == uintvoidret); - assert_eq!(uintuintuintuintret, uintuintuintuintret); + assert!(uintuintuintuintret == uintuintuintuintret); } diff --git a/src/test/run-pass/extern-pass-TwoU32s.rs b/src/test/run-pass/extern-pass-TwoU32s.rs index 592d42c65d1..ea093f1daaa 100644 --- a/src/test/run-pass/extern-pass-TwoU32s.rs +++ b/src/test/run-pass/extern-pass-TwoU32s.rs @@ -11,7 +11,7 @@ // Test a foreign function that accepts and returns a struct // by value. -#[deriving(Eq)] +#[deriving(Eq, Show)] struct TwoU32s { one: u32, two: u32 } diff --git a/src/test/run-pass/extern-pass-TwoU64s.rs b/src/test/run-pass/extern-pass-TwoU64s.rs index 8bca7a946e5..a716e038507 100644 --- a/src/test/run-pass/extern-pass-TwoU64s.rs +++ b/src/test/run-pass/extern-pass-TwoU64s.rs @@ -13,7 +13,7 @@ // ignore-win32 #9205 -#[deriving(Eq)] +#[deriving(Eq, Show)] struct TwoU64s { one: u64, two: u64 } diff --git a/src/test/run-pass/extern-take-value.rs b/src/test/run-pass/extern-take-value.rs index b883fbd6f6a..1934ef8024f 100644 --- a/src/test/run-pass/extern-take-value.rs +++ b/src/test/run-pass/extern-take-value.rs @@ -19,6 +19,6 @@ pub fn main() { let b: extern "C" fn() = f; let c: extern "C" fn() = g; - assert_eq!(a, b); + assert!(a == b); assert!(a != c); } diff --git a/src/test/run-pass/generic-default-type-params.rs b/src/test/run-pass/generic-default-type-params.rs index 889d5c948eb..8be8fcbdd54 100644 --- a/src/test/run-pass/generic-default-type-params.rs +++ b/src/test/run-pass/generic-default-type-params.rs @@ -50,10 +50,10 @@ fn default_foo(x: Foo) { assert_eq!(x.baz(), (1, 'a')); } -#[deriving(Eq)] +#[deriving(Eq, Show)] struct BazHelper<T>(T); -#[deriving(Eq)] +#[deriving(Eq, Show)] // Ensure that we can use previous type parameters in defaults. struct Baz<T, U = BazHelper<T>, V = Option<U>>(T, U, V); diff --git a/src/test/run-pass/glob-std.rs b/src/test/run-pass/glob-std.rs index c1e6f04e67d..39261094911 100644 --- a/src/test/run-pass/glob-std.rs +++ b/src/test/run-pass/glob-std.rs @@ -11,6 +11,8 @@ // ignore-fast check-fast doesn't like 'extern crate extra' // ignore-win32 TempDir may cause IoError on windows: #10462 +#[feature(macro_rules)]; + extern crate extra; extern crate glob; @@ -20,6 +22,12 @@ use std::unstable::finally::Finally; use std::{os, unstable}; use std::io; +macro_rules! assert_eq ( ($e1:expr, $e2:expr) => ( + if $e1 != $e2 { + fail!("{} != {}", stringify!($e1), stringify!($e2)) + } +) ) + pub fn main() { fn mk_file(path: &str, directory: bool) { if directory { diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index d6dfdde1aa6..7c2c1eab87b 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -26,7 +26,7 @@ pub mod pipes { payload: Option<T> } - #[deriving(Eq)] + #[deriving(Eq, Show)] #[repr(int)] pub enum state { empty, diff --git a/src/test/run-pass/monomorphize-abi-alignment.rs b/src/test/run-pass/monomorphize-abi-alignment.rs index 0ca606b2cd3..58d4d6a3dba 100644 --- a/src/test/run-pass/monomorphize-abi-alignment.rs +++ b/src/test/run-pass/monomorphize-abi-alignment.rs @@ -20,9 +20,9 @@ struct S<T> { i:u8, t:T } impl<T> S<T> { fn unwrap(self) -> T { self.t } } -#[deriving(Eq)] +#[deriving(Eq, Show)] struct A((u32, u32)); -#[deriving(Eq)] +#[deriving(Eq, Show)] struct B(u64); pub fn main() { diff --git a/src/test/run-pass/newtype-temporary.rs b/src/test/run-pass/newtype-temporary.rs index 3db333f36b8..1ed93dd278b 100644 --- a/src/test/run-pass/newtype-temporary.rs +++ b/src/test/run-pass/newtype-temporary.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[deriving(Eq)] +#[deriving(Eq, Show)] struct Foo(uint); fn foo() -> Foo { diff --git a/src/test/run-pass/operator-overloading.rs b/src/test/run-pass/operator-overloading.rs index 9c4b10da3a1..c6819971e35 100644 --- a/src/test/run-pass/operator-overloading.rs +++ b/src/test/run-pass/operator-overloading.rs @@ -13,6 +13,7 @@ use std::cmp; use std::ops; +#[deriving(Show)] struct Point { x: int, y: int diff --git a/src/test/run-pass/packed-struct-generic-layout.rs b/src/test/run-pass/packed-struct-generic-layout.rs index 91b49944be2..8b20b8e14c4 100644 --- a/src/test/run-pass/packed-struct-generic-layout.rs +++ b/src/test/run-pass/packed-struct-generic-layout.rs @@ -22,7 +22,7 @@ pub fn main() { let s = S { a: 0xff_ff_ff_ffu32, b: 1, c: 0xaa_aa_aa_aa as i32 }; let transd : [u8, .. 9] = cast::transmute(s); // Don't worry about endianness, the numbers are palindromic. - assert_eq!(transd, + assert!(transd == [0xff, 0xff, 0xff, 0xff, 1, 0xaa, 0xaa, 0xaa, 0xaa]); @@ -31,7 +31,7 @@ pub fn main() { let s = S { a: 1u8, b: 2u8, c: 0b10000001_10000001 as i16}; let transd : [u8, .. 4] = cast::transmute(s); // Again, no endianness problems. - assert_eq!(transd, + assert!(transd == [1, 2, 0b10000001, 0b10000001]); } } diff --git a/src/test/run-pass/packed-struct-layout.rs b/src/test/run-pass/packed-struct-layout.rs index f361db4a4b5..0dc78180500 100644 --- a/src/test/run-pass/packed-struct-layout.rs +++ b/src/test/run-pass/packed-struct-layout.rs @@ -26,11 +26,11 @@ pub fn main() { unsafe { let s4 = S4 { a: 1, b: [2,3,4] }; let transd : [u8, .. 4] = cast::transmute(s4); - assert_eq!(transd, [1, 2, 3, 4]); + assert!(transd == [1, 2, 3, 4]); let s5 = S5 { a: 1, b: 0xff_00_00_ff }; let transd : [u8, .. 5] = cast::transmute(s5); // Don't worry about endianness, the u32 is palindromic. - assert_eq!(transd, [1, 0xff, 0, 0, 0xff]); + assert!(transd == [1, 0xff, 0, 0, 0xff]); } } diff --git a/src/test/run-pass/packed-struct-vec.rs b/src/test/run-pass/packed-struct-vec.rs index f1824423064..94e4e3c6bef 100644 --- a/src/test/run-pass/packed-struct-vec.rs +++ b/src/test/run-pass/packed-struct-vec.rs @@ -13,7 +13,7 @@ use std::mem; #[packed] -#[deriving(Eq)] +#[deriving(Eq, Show)] struct Foo { bar: u8, baz: u64 diff --git a/src/test/run-pass/packed-tuple-struct-layout.rs b/src/test/run-pass/packed-tuple-struct-layout.rs index b3261faddfa..0cdaeddf25d 100644 --- a/src/test/run-pass/packed-tuple-struct-layout.rs +++ b/src/test/run-pass/packed-tuple-struct-layout.rs @@ -20,11 +20,11 @@ pub fn main() { unsafe { let s4 = S4(1, [2,3,4]); let transd : [u8, .. 4] = cast::transmute(s4); - assert_eq!(transd, [1, 2, 3, 4]); + assert!(transd == [1, 2, 3, 4]); let s5 = S5(1, 0xff_00_00_ff); let transd : [u8, .. 5] = cast::transmute(s5); // Don't worry about endianness, the u32 is palindromic. - assert_eq!(transd, [1, 0xff, 0, 0, 0xff]); + assert!(transd == [1, 0xff, 0, 0, 0xff]); } } diff --git a/src/test/run-pass/regions-mock-tcx.rs b/src/test/run-pass/regions-mock-tcx.rs index 1a29bb75f91..c8e8c045614 100644 --- a/src/test/run-pass/regions-mock-tcx.rs +++ b/src/test/run-pass/regions-mock-tcx.rs @@ -27,6 +27,7 @@ use std::mem; type Type<'tcx> = &'tcx TypeStructure<'tcx>; +#[deriving(Show)] enum TypeStructure<'tcx> { TypeInt, TypeFunction(Type<'tcx>, Type<'tcx>), diff --git a/src/test/run-pass/repeat-expr-in-static.rs b/src/test/run-pass/repeat-expr-in-static.rs index d060db2bb07..9955673bb0b 100644 --- a/src/test/run-pass/repeat-expr-in-static.rs +++ b/src/test/run-pass/repeat-expr-in-static.rs @@ -12,5 +12,5 @@ static FOO: [int, ..4] = [32, ..4]; static BAR: [int, ..4] = [32, 32, 32, 32]; pub fn main() { - assert_eq!(FOO, BAR); + assert!(FOO == BAR); } diff --git a/src/test/run-pass/small-enums-with-fields.rs b/src/test/run-pass/small-enums-with-fields.rs index 06b536b8391..ef7319eca09 100644 --- a/src/test/run-pass/small-enums-with-fields.rs +++ b/src/test/run-pass/small-enums-with-fields.rs @@ -12,7 +12,7 @@ use std::mem::size_of; -#[deriving(Eq)] +#[deriving(Eq, Show)] enum Either<T, U> { Left(T), Right(U) } macro_rules! check { diff --git a/src/test/run-pass/struct-lit-functional-update-no-fields.rs b/src/test/run-pass/struct-lit-functional-update-no-fields.rs index f63a729a5b8..d6a972350b6 100644 --- a/src/test/run-pass/struct-lit-functional-update-no-fields.rs +++ b/src/test/run-pass/struct-lit-functional-update-no-fields.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[deriving(Eq,Clone)] +#[deriving(Show,Eq,Clone)] struct Foo<T> { bar: T, baz: T diff --git a/src/test/run-pass/structured-compare.rs b/src/test/run-pass/structured-compare.rs index c67a72e90c9..b21c7684f69 100644 --- a/src/test/run-pass/structured-compare.rs +++ b/src/test/run-pass/structured-compare.rs @@ -10,6 +10,7 @@ +#[deriving(Show)] enum foo { large, small, } impl Eq for foo { diff --git a/src/test/run-pass/task-comm-16.rs b/src/test/run-pass/task-comm-16.rs index 42d445dc24c..6c0520b5f28 100644 --- a/src/test/run-pass/task-comm-16.rs +++ b/src/test/run-pass/task-comm-16.rs @@ -45,6 +45,7 @@ fn test_str() { assert_eq!(s1[3], 't' as u8); } +#[deriving(Show)] enum t { tag1, tag2(int), diff --git a/src/test/run-pass/trait-inheritance-overloading-simple.rs b/src/test/run-pass/trait-inheritance-overloading-simple.rs index 3a0f2dd9464..13cfb08e81b 100644 --- a/src/test/run-pass/trait-inheritance-overloading-simple.rs +++ b/src/test/run-pass/trait-inheritance-overloading-simple.rs @@ -12,6 +12,7 @@ use std::cmp::Eq; trait MyNum : Eq { } +#[deriving(Show)] struct MyInt { val: int } impl Eq for MyInt { diff --git a/src/test/run-pass/trait-inheritance-overloading.rs b/src/test/run-pass/trait-inheritance-overloading.rs index fb19bfa674f..f7c124b945a 100644 --- a/src/test/run-pass/trait-inheritance-overloading.rs +++ b/src/test/run-pass/trait-inheritance-overloading.rs @@ -12,6 +12,7 @@ use std::cmp::Eq; trait MyNum : Add<Self,Self> + Sub<Self,Self> + Mul<Self,Self> + Eq { } +#[deriving(Show)] struct MyInt { val: int } impl Add<MyInt, MyInt> for MyInt { diff --git a/src/test/run-pass/tuple-struct-constructor-pointer.rs b/src/test/run-pass/tuple-struct-constructor-pointer.rs index 097fdbf699b..77bfa439063 100644 --- a/src/test/run-pass/tuple-struct-constructor-pointer.rs +++ b/src/test/run-pass/tuple-struct-constructor-pointer.rs @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[deriving(Eq)] +#[deriving(Eq, Show)] struct Foo(int); -#[deriving(Eq)] +#[deriving(Eq, Show)] struct Bar(int, int); pub fn main() { diff --git a/src/test/run-pass/unique-kinds.rs b/src/test/run-pass/unique-kinds.rs index 11425a94ce9..118d0cd744d 100644 --- a/src/test/run-pass/unique-kinds.rs +++ b/src/test/run-pass/unique-kinds.rs @@ -13,7 +13,7 @@ use std::cmp::Eq; fn sendable() { fn f<T:Send + Eq>(i: T, j: T) { - assert_eq!(i, j); + assert!(i == j); } fn g<T:Send + Eq>(i: T, j: T) { @@ -31,7 +31,7 @@ fn sendable() { fn copyable() { fn f<T:Eq>(i: T, j: T) { - assert_eq!(i, j); + assert!(i == j); } fn g<T:Eq>(i: T, j: T) { @@ -49,7 +49,7 @@ fn copyable() { fn noncopyable() { fn f<T:Eq>(i: T, j: T) { - assert_eq!(i, j); + assert!(i == j); } fn g<T:Eq>(i: T, j: T) { diff --git a/src/test/run-pass/vec-matching-autoslice.rs b/src/test/run-pass/vec-matching-autoslice.rs index a2fc2c021bf..a318e0a75fb 100644 --- a/src/test/run-pass/vec-matching-autoslice.rs +++ b/src/test/run-pass/vec-matching-autoslice.rs @@ -13,7 +13,7 @@ pub fn main() { match x { [2, _, _] => fail!(), [1, a, b] => { - assert_eq!([a, b], [2, 3]); + assert!([a, b] == [2, 3]); } [_, _, _] => fail!(), } |
