change some uses of fail_unless to assert_eq
This commit is contained in:
parent
ab8e46b066
commit
3cd65c233d
16 changed files with 251 additions and 296 deletions
|
@ -1284,20 +1284,6 @@ mod tests {
|
|||
fail_unless!(a == b);
|
||||
}
|
||||
|
||||
// two fns copied from libsyntax/util/testing.rs.
|
||||
// Should they be in their own crate?
|
||||
pub pure fn check_equal_ptr<T:cmp::Eq> (given : &T, expected: &T) {
|
||||
if !((given == expected) && (expected == given )) {
|
||||
fail!(fmt!("given %?, expected %?",given,expected));
|
||||
}
|
||||
}
|
||||
|
||||
pub pure fn check_equal<T:cmp::Eq> (given : T, expected: T) {
|
||||
if !((given == expected) && (expected == given )) {
|
||||
fail!(fmt!("given %?, expected %?",given,expected));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_write_enum () {
|
||||
let bw = @io::BytesWriter();
|
||||
|
@ -1315,7 +1301,7 @@ mod tests {
|
|||
}
|
||||
}
|
||||
}
|
||||
check_equal(str::from_bytes(bw.bytes), ~"[\"frog\",[\"Henry\",349]]");
|
||||
assert_eq!(str::from_bytes(bw.bytes), ~"[\"frog\",[\"Henry\",349]]");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -1330,7 +1316,7 @@ mod tests {
|
|||
}
|
||||
}
|
||||
}
|
||||
check_equal(str::from_bytes(bw.bytes), ~"\"jodhpurs\"");
|
||||
assert_eq!(str::from_bytes(bw.bytes), ~"\"jodhpurs\"");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -1342,7 +1328,7 @@ mod tests {
|
|||
do encoder.emit_enum_variant (~"None",37,1242) {
|
||||
}
|
||||
}
|
||||
check_equal(str::from_bytes(bw.bytes), ~"null");
|
||||
assert_eq!(str::from_bytes(bw.bytes), ~"null");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue