diff --git a/src/libcore/core.rc b/src/libcore/core.rc index ccfeb0de0e7..21d83618684 100644 --- a/src/libcore/core.rc +++ b/src/libcore/core.rc @@ -52,6 +52,14 @@ Implicitly, all crates behave as if they included the following prologue: #[deny(non_camel_case_types)]; #[allow(deprecated_mutable_fields)]; +// On Linux, link to the runtime with -lrt. +#[cfg(target_os = "linux")] +pub mod linkhack { + #[link_args="-lrustrt -lrt"] + extern { + } +} + /* The Prelude. */ pub mod prelude; diff --git a/src/libcore/num/int-template.rs b/src/libcore/num/int-template.rs index 8096e6f99e7..2f59b4c50de 100644 --- a/src/libcore/num/int-template.rs +++ b/src/libcore/num/int-template.rs @@ -298,17 +298,22 @@ fn test_parse_bytes() { fail_unless!(parse_bytes(to_bytes(~"1001"), 2u) == Some(9 as T)); fail_unless!(parse_bytes(to_bytes(~"123"), 8u) == Some(83 as T)); fail_unless!(i32::parse_bytes(to_bytes(~"123"), 16u) == Some(291 as i32)); - fail_unless!(i32::parse_bytes(to_bytes(~"ffff"), 16u) == Some(65535 as i32)); - fail_unless!(i32::parse_bytes(to_bytes(~"FFFF"), 16u) == Some(65535 as i32)); + fail_unless!(i32::parse_bytes(to_bytes(~"ffff"), 16u) == + Some(65535 as i32)); + fail_unless!(i32::parse_bytes(to_bytes(~"FFFF"), 16u) == + Some(65535 as i32)); fail_unless!(parse_bytes(to_bytes(~"z"), 36u) == Some(35 as T)); fail_unless!(parse_bytes(to_bytes(~"Z"), 36u) == Some(35 as T)); fail_unless!(parse_bytes(to_bytes(~"-123"), 10u) == Some(-123 as T)); fail_unless!(parse_bytes(to_bytes(~"-1001"), 2u) == Some(-9 as T)); fail_unless!(parse_bytes(to_bytes(~"-123"), 8u) == Some(-83 as T)); - fail_unless!(i32::parse_bytes(to_bytes(~"-123"), 16u) == Some(-291 as i32)); - fail_unless!(i32::parse_bytes(to_bytes(~"-ffff"), 16u) == Some(-65535 as i32)); - fail_unless!(i32::parse_bytes(to_bytes(~"-FFFF"), 16u) == Some(-65535 as i32)); + fail_unless!(i32::parse_bytes(to_bytes(~"-123"), 16u) == + Some(-291 as i32)); + fail_unless!(i32::parse_bytes(to_bytes(~"-ffff"), 16u) == + Some(-65535 as i32)); + fail_unless!(i32::parse_bytes(to_bytes(~"-FFFF"), 16u) == + Some(-65535 as i32)); fail_unless!(parse_bytes(to_bytes(~"-z"), 36u) == Some(-35 as T)); fail_unless!(parse_bytes(to_bytes(~"-Z"), 36u) == Some(-35 as T)); diff --git a/src/libcore/num/uint-template.rs b/src/libcore/num/uint-template.rs index 8346a45601e..11bd7dbfd3a 100644 --- a/src/libcore/num/uint-template.rs +++ b/src/libcore/num/uint-template.rs @@ -266,8 +266,10 @@ pub fn test_parse_bytes() { fail_unless!(parse_bytes(to_bytes(~"123"), 10u) == Some(123u as T)); fail_unless!(parse_bytes(to_bytes(~"1001"), 2u) == Some(9u as T)); fail_unless!(parse_bytes(to_bytes(~"123"), 8u) == Some(83u as T)); - fail_unless!(u16::parse_bytes(to_bytes(~"123"), 16u) == Some(291u as u16)); - fail_unless!(u16::parse_bytes(to_bytes(~"ffff"), 16u) == Some(65535u as u16)); + fail_unless!(u16::parse_bytes(to_bytes(~"123"), 16u) == + Some(291u as u16)); + fail_unless!(u16::parse_bytes(to_bytes(~"ffff"), 16u) == + Some(65535u as u16)); fail_unless!(parse_bytes(to_bytes(~"z"), 36u) == Some(35u as T)); fail_unless!(parse_bytes(to_bytes(~"Z"), 10u).is_none()); diff --git a/src/libcore/os.rs b/src/libcore/os.rs index 97715c41f92..5c73e45364b 100644 --- a/src/libcore/os.rs +++ b/src/libcore/os.rs @@ -313,7 +313,8 @@ pub fn waitpid(pid: pid_t) -> c_int { use libc::funcs::posix01::wait::*; let mut status = 0 as c_int; - fail_unless!((waitpid(pid, &mut status, 0 as c_int) != (-1 as c_int))); + fail_unless!((waitpid(pid, &mut status, 0 as c_int) != + (-1 as c_int))); return status; } } @@ -1309,7 +1310,8 @@ mod tests { #[test] fn path_exists() { fail_unless!((os::path_exists(&Path(".")))); - fail_unless!((!os::path_exists(&Path("test/nonexistent-bogus-path")))); + fail_unless!((!os::path_exists(&Path( + "test/nonexistent-bogus-path")))); } #[test] diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 49dd3443443..ebf41dc48f4 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -328,10 +328,12 @@ pub fn test() { fail_unless!((v1[0] == 0u16 && v1[1] == 32001u16 && v1[2] == 0u16)); copy_memory(vec::raw::to_mut_ptr(v1), offset(vec::raw::to_ptr(v0), 2u), 1u); - fail_unless!((v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 0u16)); + fail_unless!((v1[0] == 32002u16 && v1[1] == 32001u16 && + v1[2] == 0u16)); copy_memory(mut_offset(vec::raw::to_mut_ptr(v1), 2u), vec::raw::to_ptr(v0), 1u); - fail_unless!((v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 32000u16)); + fail_unless!((v1[0] == 32002u16 && v1[1] == 32001u16 && + v1[2] == 32000u16)); } } @@ -342,9 +344,12 @@ pub fn test_position() { let s = ~"hello"; unsafe { - fail_unless!(2u == as_c_str(s, |p| position(p, |c| *c == 'l' as c_char))); - fail_unless!(4u == as_c_str(s, |p| position(p, |c| *c == 'o' as c_char))); - fail_unless!(5u == as_c_str(s, |p| position(p, |c| *c == 0 as c_char))); + fail_unless!(2u == as_c_str(s, |p| position(p, + |c| *c == 'l' as c_char))); + fail_unless!(4u == as_c_str(s, |p| position(p, + |c| *c == 'o' as c_char))); + fail_unless!(5u == as_c_str(s, |p| position(p, + |c| *c == 0 as c_char))); } } diff --git a/src/libcore/str.rs b/src/libcore/str.rs index a6c893f2104..6a0673878e0 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -2807,9 +2807,10 @@ mod tests { #[test] fn test_to_lower() { unsafe { - fail_unless!(~"" == map(~"", |c| libc::tolower(c as c_char) as char)); + fail_unless!(~"" == map(~"", + |c| libc::tolower(c as c_char) as char)); fail_unless!(~"ymca" == map(~"YMCA", - |c| libc::tolower(c as c_char) as char)); + |c| libc::tolower(c as c_char) as char)); } } @@ -2867,7 +2868,8 @@ mod tests { fail_unless!(replace(~"a", a, ~"b") == ~"b"); fail_unless!(replace(~"ab", a, ~"b") == ~"bb"); let test = ~"test"; - fail_unless!(replace(~" test test ", test, ~"toast") == ~" toast toast "); + fail_unless!(replace(~" test test ", test, ~"toast") == + ~" toast toast "); fail_unless!(replace(~" test test ", test, ~"") == ~" "); } @@ -2977,18 +2979,24 @@ mod tests { #[test] fn test_trim_left_chars() { - fail_unless!(trim_left_chars(~" *** foo *** ", ~[]) == ~" *** foo *** "); - fail_unless!(trim_left_chars(~" *** foo *** ", ~['*', ' ']) == ~"foo *** "); + fail_unless!(trim_left_chars(~" *** foo *** ", ~[]) == + ~" *** foo *** "); + fail_unless!(trim_left_chars(~" *** foo *** ", ~['*', ' ']) == + ~"foo *** "); fail_unless!(trim_left_chars(~" *** *** ", ~['*', ' ']) == ~""); - fail_unless!(trim_left_chars(~"foo *** ", ~['*', ' ']) == ~"foo *** "); + fail_unless!(trim_left_chars(~"foo *** ", ~['*', ' ']) == + ~"foo *** "); } #[test] fn test_trim_right_chars() { - fail_unless!(trim_right_chars(~" *** foo *** ", ~[]) == ~" *** foo *** "); - fail_unless!(trim_right_chars(~" *** foo *** ", ~['*', ' ']) == ~" *** foo"); + fail_unless!(trim_right_chars(~" *** foo *** ", ~[]) == + ~" *** foo *** "); + fail_unless!(trim_right_chars(~" *** foo *** ", ~['*', ' ']) == + ~" *** foo"); fail_unless!(trim_right_chars(~" *** *** ", ~['*', ' ']) == ~""); - fail_unless!(trim_right_chars(~" *** foo", ~['*', ' ']) == ~" *** foo"); + fail_unless!(trim_right_chars(~" *** foo", ~['*', ' ']) == + ~" *** foo"); } #[test] @@ -3321,7 +3329,8 @@ mod tests { #[test] fn test_map() { unsafe { - fail_unless!(~"" == map(~"", |c| libc::toupper(c as c_char) as char)); + fail_unless!(~"" == map(~"", |c| + libc::toupper(c as c_char) as char)); fail_unless!(~"YMCA" == map(~"ymca", |c| libc::toupper(c as c_char) as char)); } diff --git a/src/libcore/task/local_data.rs b/src/libcore/task/local_data.rs index b0b597182e1..72c328d4613 100644 --- a/src/libcore/task/local_data.rs +++ b/src/libcore/task/local_data.rs @@ -94,7 +94,8 @@ fn test_tls_multitask() { // TLS shouldn't carry over. fail_unless!(local_data_get(my_key).is_none()); local_data_set(my_key, @~"child data"); - fail_unless!(*(local_data_get(my_key).get()) == ~"child data"); + fail_unless!(*(local_data_get(my_key).get()) == + ~"child data"); // should be cleaned up for us } } diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs index a6aa365ac33..065feaebb51 100644 --- a/src/libcore/task/mod.rs +++ b/src/libcore/task/mod.rs @@ -940,6 +940,8 @@ fn test_spawn_sched_childs_on_default_sched() { #[cfg(test)] pub mod testrt { + use libc; + #[nolink] pub extern { unsafe fn rust_dbg_lock_create() -> *libc::c_void; diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 1a8a2518ab0..365de1ac3e2 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -3409,7 +3409,8 @@ mod tests { fail_unless!(rsplit(~[], f) == ~[]); fail_unless!(rsplit(~[1, 2], f) == ~[~[1, 2]]); fail_unless!(rsplit(~[1, 2, 3], f) == ~[~[1, 2], ~[]]); - fail_unless!(rsplit(~[1, 2, 3, 4, 3, 5], f) == ~[~[1, 2], ~[4], ~[5]]); + fail_unless!(rsplit(~[1, 2, 3, 4, 3, 5], f) == + ~[~[1, 2], ~[4], ~[5]]); } #[test] @@ -3427,9 +3428,12 @@ mod tests { fn test_partition() { // FIXME (#4355 maybe): using v.partition here crashes fail_unless!(partition(~[], |x: &int| *x < 3) == (~[], ~[])); - fail_unless!(partition(~[1, 2, 3], |x: &int| *x < 4) == (~[1, 2, 3], ~[])); - fail_unless!(partition(~[1, 2, 3], |x: &int| *x < 2) == (~[1], ~[2, 3])); - fail_unless!(partition(~[1, 2, 3], |x: &int| *x < 0) == (~[], ~[1, 2, 3])); + fail_unless!(partition(~[1, 2, 3], |x: &int| *x < 4) == + (~[1, 2, 3], ~[])); + fail_unless!(partition(~[1, 2, 3], |x: &int| *x < 2) == + (~[1], ~[2, 3])); + fail_unless!(partition(~[1, 2, 3], |x: &int| *x < 0) == + (~[], ~[1, 2, 3])); } #[test] diff --git a/src/librustc/middle/trans/callee.rs b/src/librustc/middle/trans/callee.rs index ba1c753729c..d4ff0d74a47 100644 --- a/src/librustc/middle/trans/callee.rs +++ b/src/librustc/middle/trans/callee.rs @@ -704,7 +704,8 @@ pub fn trans_arg_expr(bcx: block, // FIXME(#3548) use the adjustments table match autoref_arg { DoAutorefArg => { - fail_unless!(!bcx.ccx().maps.moves_map.contains_key(&arg_expr.id)); + fail_unless!(! + bcx.ccx().maps.moves_map.contains_key(&arg_expr.id)); val = arg_datum.to_ref_llval(bcx); } DontAutorefArg => { diff --git a/src/librustdoc/desc_to_brief_pass.rs b/src/librustdoc/desc_to_brief_pass.rs index a0733121b7c..51574c2c3c7 100644 --- a/src/librustdoc/desc_to_brief_pass.rs +++ b/src/librustdoc/desc_to_brief_pass.rs @@ -90,7 +90,8 @@ fn should_promote_desc() { #[test] fn should_promote_trait_method_desc() { let doc = test::mk_doc(~"trait i { #[doc = \"desc\"] fn a(); }"); - fail_unless!(doc.cratemod().traits()[0].methods[0].brief == Some(~"desc")); + fail_unless!(doc.cratemod().traits()[0].methods[0].brief == + Some(~"desc")); } #[test] diff --git a/src/librustdoc/extract.rs b/src/librustdoc/extract.rs index ba6e102785a..fc784722b25 100644 --- a/src/librustdoc/extract.rs +++ b/src/librustdoc/extract.rs @@ -380,7 +380,8 @@ mod test { #[test] pub fn extract_mods_deep() { let doc = mk_doc(~"mod a { mod b { mod c { } } }"); - fail_unless!(doc.cratemod().mods()[0].mods()[0].mods()[0].name() == ~"c"); + fail_unless!(doc.cratemod().mods()[0].mods()[0].mods()[0].name() == + ~"c"); } #[test] diff --git a/src/librustdoc/markdown_index_pass.rs b/src/librustdoc/markdown_index_pass.rs index b18694d00db..12d875945d9 100644 --- a/src/librustdoc/markdown_index_pass.rs +++ b/src/librustdoc/markdown_index_pass.rs @@ -160,7 +160,8 @@ fn pandoc_header_id(header: &str) -> ~str { #[test] fn should_remove_punctuation_from_headers() { - fail_unless!(pandoc_header_id(~"impl foo of bar") == ~"impl-foo-of-bara"); + fail_unless!(pandoc_header_id(~"impl foo of bar") == + ~"impl-foo-of-bara"); fail_unless!(pandoc_header_id(~"impl of num::num for int") == ~"impl-of-numnum-for-int"); fail_unless!(pandoc_header_id(~"impl of num::num for int/&") diff --git a/src/librustdoc/markdown_pass.rs b/src/librustdoc/markdown_pass.rs index 888814f9e7b..d7dd288ed89 100644 --- a/src/librustdoc/markdown_pass.rs +++ b/src/librustdoc/markdown_pass.rs @@ -752,7 +752,8 @@ fn should_write_impl_header() { #[test] fn should_write_impl_header_with_trait() { let markdown = test::render(~"impl j for int { fn a() { } }"); - fail_unless!(str::contains(markdown, ~"## Implementation of `j` for `int`")); + fail_unless!(str::contains(markdown, + ~"## Implementation of `j` for `int`")); } #[test] diff --git a/src/librustdoc/text_pass.rs b/src/librustdoc/text_pass.rs index 1bd83375607..797f276de0a 100644 --- a/src/librustdoc/text_pass.rs +++ b/src/librustdoc/text_pass.rs @@ -265,7 +265,8 @@ fn should_execute_on_trait_method_section_bodies() { # Header\n\ Body \"]\ fn a(); }"); - fail_unless!(doc.cratemod().traits()[0].methods[0].sections[0].body == ~"Body"); + fail_unless!(doc.cratemod().traits()[0].methods[0].sections[0].body == + ~"Body"); } #[test] @@ -288,7 +289,8 @@ fn should_execute_on_impl_method_section_bodies() { # Header\n\ Body \"]\ fn a() { } }"); - fail_unless!(doc.cratemod().impls()[0].methods[0].sections[0].body == ~"Body"); + fail_unless!(doc.cratemod().impls()[0].methods[0].sections[0].body == + ~"Body"); } #[cfg(test)] diff --git a/src/librustdoc/tystr_pass.rs b/src/librustdoc/tystr_pass.rs index 2765a844f30..e5f304ee8ac 100644 --- a/src/librustdoc/tystr_pass.rs +++ b/src/librustdoc/tystr_pass.rs @@ -92,7 +92,8 @@ fn should_add_fn_sig() { #[test] fn should_add_foreign_fn_sig() { let doc = test::mk_doc(~"extern mod a { fn a() -> int; }"); - fail_unless!(doc.cratemod().nmods()[0].fns[0].sig == Some(~"fn a() -> int")); + fail_unless!(doc.cratemod().nmods()[0].fns[0].sig == + Some(~"fn a() -> int")); } fn fold_const( @@ -165,7 +166,8 @@ fn fold_enum( #[test] fn should_add_variant_sigs() { let doc = test::mk_doc(~"enum a { b(int) }"); - fail_unless!(doc.cratemod().enums()[0].variants[0].sig == Some(~"b(int)")); + fail_unless!(doc.cratemod().enums()[0].variants[0].sig == + Some(~"b(int)")); } fn fold_trait( @@ -407,7 +409,8 @@ fn strip_struct_extra_stuff(item: @ast::item) -> @ast::item { #[test] fn should_add_struct_defs() { let doc = test::mk_doc(~"struct S { field: () }"); - fail_unless!((&doc.cratemod().structs()[0].sig).get().contains("struct S {")); + fail_unless!((&doc.cratemod().structs()[0].sig).get().contains( + "struct S {")); } #[test] diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index 84b24efac96..e7503f0082c 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -519,7 +519,8 @@ mod tests { let _ = p.recv(); do arc2.access_cond |one, cond| { cond.signal(); - fail_unless!(*one == 0); // Parent should fail when it wakes up. + // Parent should fail when it wakes up. + fail_unless!(*one == 0); } } diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index b54c50da35c..55ec29d2337 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -1238,7 +1238,8 @@ mod tests { #[test] pub fn test_from_bools() { - fail_unless!(from_bools([true, false, true, true]).to_str() == ~"1011"); + fail_unless!(from_bools([true, false, true, true]).to_str() == + ~"1011"); } #[test] diff --git a/src/libstd/md4.rs b/src/libstd/md4.rs index 3dc669da571..eb4bd6fe23f 100644 --- a/src/libstd/md4.rs +++ b/src/libstd/md4.rs @@ -128,7 +128,8 @@ fn test_md4() { fail_unless!(md4_text(~"") == ~"31d6cfe0d16ae931b73c59d7e0c089c0"); fail_unless!(md4_text(~"a") == ~"bde52cb31de33e46245e05fbdbd6fb24"); fail_unless!(md4_text(~"abc") == ~"a448017aaf21d8525fc10ae87aa6729d"); - fail_unless!(md4_text(~"message digest") == ~"d9130a8164549fe818874806e1c7014b"); + fail_unless!(md4_text(~"message digest") == + ~"d9130a8164549fe818874806e1c7014b"); fail_unless!(md4_text(~"abcdefghijklmnopqrstuvwxyz") == ~"d79e1c308aa5bbcdeea8ed63df412da9"); fail_unless!(md4_text( diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs index 0739f624882..0bb8fdd3738 100644 --- a/src/libstd/net_url.rs +++ b/src/libstd/net_url.rs @@ -971,7 +971,8 @@ mod tests { fail_unless!(encode_component("") == ~""); fail_unless!(encode_component("http://example.com") == ~"http%3A%2F%2Fexample.com"); - fail_unless!(encode_component("foo bar% baz") == ~"foo%20bar%25%20baz"); + fail_unless!(encode_component("foo bar% baz") == + ~"foo%20bar%25%20baz"); fail_unless!(encode_component(" ") == ~"%20"); fail_unless!(encode_component("!") == ~"%21"); fail_unless!(encode_component("#") == ~"%23"); @@ -1065,7 +1066,8 @@ mod tests { let mut m = LinearMap::new(); m.insert(~"foo bar", ~[~"abc", ~"12 = 34"]); - fail_unless!(encode_form_urlencoded(&m) == ~"foo+bar=abc&foo+bar=12+%3D+34"); + fail_unless!(encode_form_urlencoded(&m) == + ~"foo+bar=abc&foo+bar=12+%3D+34"); } #[test] diff --git a/src/libstd/test.rs b/src/libstd/test.rs index b43389b9da2..7286ce5e2bd 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -962,7 +962,9 @@ mod tests { for vec::each(pairs) |p| { match *p { - (ref a, ref b) => { fail_unless!((*a == b.desc.name.to_str())); } + (ref a, ref b) => { + fail_unless!((*a == b.desc.name.to_str())); + } } } } diff --git a/src/libstd/time.rs b/src/libstd/time.rs index d008ad15006..d6e19515ba6 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -22,10 +22,6 @@ const NSEC_PER_SEC: i32 = 1_000_000_000_i32; pub mod rustrt { use super::Tm; - #[cfg(target_os = "linux")] - #[link_args = "-lrt"] - pub extern {} - #[abi = "cdecl"] pub extern { pub unsafe fn get_time(sec: &mut i64, nsec: &mut i32); @@ -1164,10 +1160,14 @@ mod tests { fail_unless!(test(~"6", ~"%w")); fail_unless!(test(~"2009", ~"%Y")); fail_unless!(test(~"09", ~"%y")); - fail_unless!(result::unwrap(strptime(~"UTC", ~"%Z")).tm_zone == ~"UTC"); - fail_unless!(result::unwrap(strptime(~"PST", ~"%Z")).tm_zone == ~""); - fail_unless!(result::unwrap(strptime(~"-0000", ~"%z")).tm_gmtoff == 0); - fail_unless!(result::unwrap(strptime(~"-0800", ~"%z")).tm_gmtoff == 0); + fail_unless!(result::unwrap(strptime(~"UTC", ~"%Z")).tm_zone == + ~"UTC"); + fail_unless!(result::unwrap(strptime(~"PST", ~"%Z")).tm_zone == + ~""); + fail_unless!(result::unwrap(strptime(~"-0000", ~"%z")).tm_gmtoff == + 0); + fail_unless!(result::unwrap(strptime(~"-0800", ~"%z")).tm_gmtoff == + 0); fail_unless!(test(~"%", ~"%%")); } diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs index 878696a9a90..f06f64dde01 100644 --- a/src/libstd/treemap.rs +++ b/src/libstd/treemap.rs @@ -790,7 +790,8 @@ mod test_treemap { fail_unless!(r.key.cmp(&parent.key) == Greater); let red = r.level == parent.level; if parent_red { fail_unless!(!red) } // no dual horizontal links - fail_unless!(red || r.level == parent.level - 1); // right red or black + // Right red or black + fail_unless!(red || r.level == parent.level - 1); check_left(&r.left, r); check_right(&r.right, r, red); } diff --git a/src/libstd/uv_ll.rs b/src/libstd/uv_ll.rs index a48dd7b4f86..fa415e0875b 100644 --- a/src/libstd/uv_ll.rs +++ b/src/libstd/uv_ll.rs @@ -1859,7 +1859,8 @@ pub mod test { // .. can't get the uv::ll::sockaddr_in6 to == 28 :/ // .. so the type always appears to be 32 in size.. which is // good, i guess.. better too big than too little - fail_unless!((4u+foreign_handle_size as uint) == rust_handle_size); + fail_unless!((4u+foreign_handle_size as uint) == + rust_handle_size); } } #[test] @@ -1873,7 +1874,8 @@ pub mod test { foreign_handle_size as uint, rust_handle_size); log(debug, output); // FIXME #1645 .. see note above about struct padding - fail_unless!((4u+foreign_handle_size as uint) == rust_handle_size); + fail_unless!((4u+foreign_handle_size as uint) == + rust_handle_size); } } diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index eafe871a288..001e1b0daf6 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -54,7 +54,8 @@ impl gen_send for message { message(ref _id, span, ref tys, this, Some(ref next_state)) => { debug!("pipec: next state exists"); let next = this.proto.get_state(next_state.state); - fail_unless!(next_state.tys.len() == next.generics.ty_params.len()); + fail_unless!(next_state.tys.len() == + next.generics.ty_params.len()); let arg_names = tys.mapi(|i, _ty| cx.ident_of(~"x_"+i.to_str())); let args_ast = vec::map2(arg_names, *tys, |n, t| cx.arg(*n, *t)); diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index df658b96d7b..8557ef22fc6 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -405,7 +405,9 @@ pub impl Printer { self.print(x, L); match x { BREAK(b) => self.left_total += b.blank_space, - STRING(_, len) => { fail_unless!((len == L)); self.left_total += len; } + STRING(_, len) => { + fail_unless!((len == L)); self.left_total += len; + } _ => () } if self.left != self.right { diff --git a/src/test/compile-fail/borrowck-assign-comp-idx.rs b/src/test/compile-fail/borrowck-assign-comp-idx.rs index ded47fc9f7f..9c175ed42b6 100644 --- a/src/test/compile-fail/borrowck-assign-comp-idx.rs +++ b/src/test/compile-fail/borrowck-assign-comp-idx.rs @@ -8,7 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -type point = { x: int, y: int }; +struct Point { + x: int, + y: int, +} fn a() { let mut p = ~[1]; diff --git a/src/test/compile-fail/borrowck-uniq-via-box.rs b/src/test/compile-fail/borrowck-uniq-via-box.rs index 9a63c8698c6..914b5caa011 100644 --- a/src/test/compile-fail/borrowck-uniq-via-box.rs +++ b/src/test/compile-fail/borrowck-uniq-via-box.rs @@ -8,17 +8,33 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +struct Rec { + f: ~int, +} + +struct Outer { + f: Inner +} + +struct Inner { + g: Innermost +} + +struct Innermost { + h: ~int, +} + fn borrow(_v: &int) {} fn box_mut(v: @mut ~int) { borrow(*v); //~ ERROR illegal borrow unless pure } -fn box_mut_rec(v: @mut {f: ~int}) { +fn box_mut_rec(v: @mut Rec) { borrow(v.f); //~ ERROR illegal borrow unless pure } -fn box_mut_recs(v: @mut {f: {g: {h: ~int}}}) { +fn box_mut_recs(v: @mut Outer) { borrow(v.f.g.h); //~ ERROR illegal borrow unless pure } @@ -26,11 +42,11 @@ fn box_imm(v: @~int) { borrow(*v); // OK } -fn box_imm_rec(v: @{f: ~int}) { +fn box_imm_rec(v: @Rec) { borrow(v.f); // OK } -fn box_imm_recs(v: @{f: {g: {h: ~int}}}) { +fn box_imm_recs(v: @Outer) { borrow(v.f.g.h); // OK } @@ -38,13 +54,14 @@ fn box_const(v: @const ~int) { borrow(*v); //~ ERROR illegal borrow unless pure } -fn box_const_rec(v: @const {f: ~int}) { +fn box_const_rec(v: @const Rec) { borrow(v.f); //~ ERROR illegal borrow unless pure } -fn box_const_recs(v: @const {f: {g: {h: ~int}}}) { +fn box_const_recs(v: @const Outer) { borrow(v.f.g.h); //~ ERROR illegal borrow unless pure } fn main() { } + diff --git a/src/test/compile-fail/borrowck-uniq-via-ref.rs b/src/test/compile-fail/borrowck-uniq-via-ref.rs index 8d6e7039057..2cf363e13ee 100644 --- a/src/test/compile-fail/borrowck-uniq-via-ref.rs +++ b/src/test/compile-fail/borrowck-uniq-via-ref.rs @@ -8,17 +8,33 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +struct Rec { + f: ~int, +} + +struct Outer { + f: Inner +} + +struct Inner { + g: Innermost +} + +struct Innermost { + h: ~int, +} + fn borrow(_v: &int) {} fn box_mut(v: &mut ~int) { borrow(*v); // OK: &mut -> &imm } -fn box_mut_rec(v: &mut {f: ~int}) { +fn box_mut_rec(v: &mut Rec) { borrow(v.f); // OK: &mut -> &imm } -fn box_mut_recs(v: &mut {f: {g: {h: ~int}}}) { +fn box_mut_recs(v: &mut Outer) { borrow(v.f.g.h); // OK: &mut -> &imm } @@ -26,11 +42,11 @@ fn box_imm(v: &~int) { borrow(*v); // OK } -fn box_imm_rec(v: &{f: ~int}) { +fn box_imm_rec(v: &Rec) { borrow(v.f); // OK } -fn box_imm_recs(v: &{f: {g: {h: ~int}}}) { +fn box_imm_recs(v: &Outer) { borrow(v.f.g.h); // OK } @@ -38,11 +54,11 @@ fn box_const(v: &const ~int) { borrow(*v); //~ ERROR illegal borrow unless pure } -fn box_const_rec(v: &const {f: ~int}) { +fn box_const_rec(v: &const Rec) { borrow(v.f); //~ ERROR illegal borrow unless pure } -fn box_const_recs(v: &const {f: {g: {h: ~int}}}) { +fn box_const_recs(v: &const Outer) { borrow(v.f.g.h); //~ ERROR illegal borrow unless pure } diff --git a/src/test/compile-fail/empty-linkname.rs b/src/test/compile-fail/empty-linkname.rs index 65a4378a219..e5c304efd67 100644 --- a/src/test/compile-fail/empty-linkname.rs +++ b/src/test/compile-fail/empty-linkname.rs @@ -1,3 +1,5 @@ +// xfail-test + // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. diff --git a/src/test/compile-fail/empty-linkname2.rs b/src/test/compile-fail/empty-linkname2.rs index 2b00f564f05..30ad2c361b1 100644 --- a/src/test/compile-fail/empty-linkname2.rs +++ b/src/test/compile-fail/empty-linkname2.rs @@ -1,3 +1,5 @@ +// xfail-test + // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. diff --git a/src/test/compile-fail/for-loop-decl.rs b/src/test/compile-fail/for-loop-decl.rs index 3f497094208..952bf8c060a 100644 --- a/src/test/compile-fail/for-loop-decl.rs +++ b/src/test/compile-fail/for-loop-decl.rs @@ -13,10 +13,16 @@ extern mod std; use std::oldmap::HashMap; use std::bitv; -type fn_info = {vars: HashMap}; -type var_info = {a: uint, b: uint}; +struct FnInfo { + vars: HashMap +} -fn bitv_to_str(enclosing: fn_info, v: ~bitv::Bitv) -> str { +struct VarInfo { + a: uint, + b: uint, +} + +fn bitv_to_str(enclosing: FnInfo, v: ~bitv::Bitv) -> str { let s = ""; // error is that the value type in the hash map is var_info, not a box diff --git a/src/test/compile-fail/issue-1763.rs b/src/test/compile-fail/issue-1763.rs deleted file mode 100644 index 5cd1eb87471..00000000000 --- a/src/test/compile-fail/issue-1763.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Issue #1763 - infer types correctly - -type actor = { //~ ERROR type parameter `T` is unused - unused: bool -}; - -fn main() {} diff --git a/src/test/compile-fail/issue-3021-d.rs b/src/test/compile-fail/issue-3021-d.rs index 7381d36a223..4efbec92948 100644 --- a/src/test/compile-fail/issue-3021-d.rs +++ b/src/test/compile-fail/issue-3021-d.rs @@ -16,19 +16,19 @@ trait siphash { } fn siphash(k0 : u64, k1 : u64) -> siphash { - type sipstate = { - mut v0 : u64, - mut v1 : u64, - }; + struct SipState { + v0: u64, + v1: u64, + } - fn mk_result(st : sipstate) -> u64 { + fn mk_result(st : SipState) -> u64 { let v0 = st.v0, v1 = st.v1; return v0 ^ v1; } - impl siphash for sipstate { + impl siphash for SipState { fn reset() { self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR attempted dynamic environment-capture //~^ ERROR unresolved name: `k0`. diff --git a/src/test/compile-fail/issue-3021.rs b/src/test/compile-fail/issue-3021.rs index e5a7a7990e5..117156748ae 100644 --- a/src/test/compile-fail/issue-3021.rs +++ b/src/test/compile-fail/issue-3021.rs @@ -10,17 +10,16 @@ extern mod std; -trait siphash { +trait SipHash { fn reset(); } -fn siphash(k0 : u64) -> siphash { - type sipstate = { - mut v0 : u64, - }; +fn siphash(k0 : u64) -> SipHash { + struct SipState { + v0: u64, + } - - impl siphash for sipstate { + impl SipHash for SipState { fn reset() { self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR attempted dynamic environment-capture //~^ ERROR unresolved name: `k0`. diff --git a/src/test/compile-fail/issue-3296.rs b/src/test/compile-fail/issue-3296.rs index 8d6ca678dfd..00425825e3f 100644 --- a/src/test/compile-fail/issue-3296.rs +++ b/src/test/compile-fail/issue-3296.rs @@ -14,7 +14,9 @@ struct Deserializer : std::serialization::deserializer{ //~ ERROR obsolete synta x: () } -type foo = {a: (),}; +struct Foo { + a: () +} fn deserialize_foo<__D: std::serialization::deserializer>(&&__d: __D) { } diff --git a/src/test/compile-fail/main-wrong-type.rs b/src/test/compile-fail/main-wrong-type.rs index 33d7b913daf..cdd3b19f0ae 100644 --- a/src/test/compile-fail/main-wrong-type.rs +++ b/src/test/compile-fail/main-wrong-type.rs @@ -8,6 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn main(foo: {x: int, y: int}) { -//~^ ERROR Wrong type in main function: found `extern fn({x: int,y: int})` +struct S { + x: int, + y: int, +} + +fn main(foo: S) { +//~^ ERROR Wrong type in main function: found `extern fn(S)` } diff --git a/src/test/compile-fail/mutable-huh-variance-rec.rs b/src/test/compile-fail/mutable-huh-variance-rec.rs deleted file mode 100644 index 6d79e23e999..00000000000 --- a/src/test/compile-fail/mutable-huh-variance-rec.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern: mismatched types - -struct S { - g: ~[int] -} - -fn main() { - let v = S {g: ~[0]}; - - fn f(&&v: {g: ~[const int]}) { - v.g = ~[3] - } - - f(v); -} diff --git a/src/test/compile-fail/pure-higher-order.rs b/src/test/compile-fail/pure-higher-order.rs index 23192cec9a2..e5638e11ae9 100644 --- a/src/test/compile-fail/pure-higher-order.rs +++ b/src/test/compile-fail/pure-higher-order.rs @@ -12,6 +12,10 @@ // Test rules governing higher-order pure fns. +struct S<'self> { + f: &'self fn(uint) +} + pure fn range(from: uint, to: uint, f: fn(uint)) { let mut i = from; while i < to { @@ -34,11 +38,11 @@ pure fn range4(from: uint, to: uint) { range(from, to, print) //~ ERROR access to impure function prohibited in pure context } -pure fn range5(from: uint, to: uint, x: {f: fn(uint)}) { +pure fn range5<'a>(from: uint, to: uint, x: S<'a>) { range(from, to, x.f) //~ ERROR access to impure function prohibited in pure context } -pure fn range6(from: uint, to: uint, x: @{f: fn(uint)}) { +pure fn range6<'a>(from: uint, to: uint, x: @S<'a>) { range(from, to, x.f) //~ ERROR access to impure function prohibited in pure context } diff --git a/src/test/compile-fail/pure-loop-body.rs b/src/test/compile-fail/pure-loop-body.rs index 9fc664e030f..43a54981dcb 100644 --- a/src/test/compile-fail/pure-loop-body.rs +++ b/src/test/compile-fail/pure-loop-body.rs @@ -8,7 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pure fn range(from: uint, to: uint, f: fn(uint) -> bool) { +struct S<'self> { + x: &'self fn(uint) +} + +pure fn range<'a>(from: uint, to: uint, f: &'a fn(uint) -> bool) { let mut i = from; while i < to { if !f(i) {return;} // Note: legal to call argument, even if it is not pure. @@ -16,13 +20,13 @@ pure fn range(from: uint, to: uint, f: fn(uint) -> bool) { } } -pure fn range2(from: uint, to: uint, f: fn(uint)) { +pure fn range2<'a>(from: uint, to: uint, f: &'a fn(uint)) { for range(from, to) |i| { f(i*2u); } } -pure fn range3(from: uint, to: uint, f: {x: fn(uint)}) { +pure fn range3<'a>(from: uint, to: uint, f: S<'a>) { for range(from, to) |i| { (f.x)(i*2u); //~ ERROR access to impure function prohibited } diff --git a/src/test/compile-fail/redundant-link-args.rs b/src/test/compile-fail/redundant-link-args.rs index 1640e16c0fd..b0f080f360b 100644 --- a/src/test/compile-fail/redundant-link-args.rs +++ b/src/test/compile-fail/redundant-link-args.rs @@ -1,3 +1,6 @@ +// xfail-fast +// xfail-test + // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. diff --git a/src/test/compile-fail/regions-in-type-items.rs b/src/test/compile-fail/regions-in-type-items.rs index 2397c8f2311..2a72744c9b6 100644 --- a/src/test/compile-fail/regions-in-type-items.rs +++ b/src/test/compile-fail/regions-in-type-items.rs @@ -8,16 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -type item_ty_yes0 = { - x: &uint //~ ERROR Illegal anonymous lifetime: anonymous lifetimes are not permitted here -}; - -type item_ty_yes1 = { +struct item_ty_yes0 { x: &'self uint -}; +} -type item_ty_yes2 = { - x: &'foo uint //~ ERROR Illegal lifetime &foo: only 'self is allowed allowed as part of a type declaration -}; +struct item_ty_yes1 { + x: &'self uint +} + +struct item_ty_yes2 { + x: &'a uint //~ ERROR only 'self is allowed +} fn main() {} diff --git a/src/test/compile-fail/regions-infer-borrow-scope-too-big.rs b/src/test/compile-fail/regions-infer-borrow-scope-too-big.rs index 063764eea0e..82d75bcf5db 100644 --- a/src/test/compile-fail/regions-infer-borrow-scope-too-big.rs +++ b/src/test/compile-fail/regions-infer-borrow-scope-too-big.rs @@ -8,7 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -type point = {x: int, y: int}; +struct point { + x: int, + y: int, +} fn x_coord(p: &r/point) -> &r/int { return &p.x; diff --git a/src/test/compile-fail/regions-infer-paramd-indirect.rs b/src/test/compile-fail/regions-infer-paramd-indirect.rs index ddf1454070c..7b2a760270c 100644 --- a/src/test/compile-fail/regions-infer-paramd-indirect.rs +++ b/src/test/compile-fail/regions-infer-paramd-indirect.rs @@ -13,7 +13,10 @@ type a<'self> = &'self int; type b<'self> = @a<'self>; -type c<'self> = {f: @b<'self>}; + +struct c<'self> { + f: @b<'self> +} trait set_f<'self> { fn set_f_ok(b: @b<'self>); diff --git a/src/test/compile-fail/terr-in-field.rs b/src/test/compile-fail/terr-in-field.rs index ac13de53902..6474a58c1cd 100644 --- a/src/test/compile-fail/terr-in-field.rs +++ b/src/test/compile-fail/terr-in-field.rs @@ -8,12 +8,19 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -type foo = {a: int, b: int}; -type bar = {a: int, b: uint}; +struct foo { + a: int, + b: int, +} + +struct bar { + a: int, + b: uint, +} fn want_foo(f: foo) {} fn have_bar(b: bar) { - want_foo(b); //~ ERROR (in field `b`, expected int but found uint) + want_foo(b); //~ ERROR (expected struct foo but found struct bar) } fn main() {} diff --git a/src/test/compile-fail/terr-sorts.rs b/src/test/compile-fail/terr-sorts.rs index c074a92144a..ad14688f08c 100644 --- a/src/test/compile-fail/terr-sorts.rs +++ b/src/test/compile-fail/terr-sorts.rs @@ -8,12 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -type foo = {a: int, b: int}; +struct foo { + a: int, + b: int, +} + type bar = @foo; fn want_foo(f: foo) {} fn have_bar(b: bar) { - want_foo(b); //~ ERROR (expected record but found @-ptr) + want_foo(b); //~ ERROR (expected struct foo but found @-ptr) } fn main() {} diff --git a/src/test/compile-fail/type-recursive.rs b/src/test/compile-fail/type-recursive.rs index 7ec16c421e3..a2b4e8d9782 100644 --- a/src/test/compile-fail/type-recursive.rs +++ b/src/test/compile-fail/type-recursive.rs @@ -8,7 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:illegal recursive type -type t1 = {foo: int, foolish: t1}; +// error-pattern:this type cannot be instantiated +struct t1 { + foo: int, + foolish: t1 +} fn main() { } diff --git a/src/test/pretty/alt-naked-expr-long.rs b/src/test/pretty/alt-naked-expr-long.rs index 73a5b864ea8..67253c9753e 100644 --- a/src/test/pretty/alt-naked-expr-long.rs +++ b/src/test/pretty/alt-naked-expr-long.rs @@ -22,5 +22,4 @@ fn main() { + ~"very" + ~"very" + ~"long" + ~"string", None => ~"none" }; - fail_unless!(y == ~"some(_)"); } diff --git a/src/test/pretty/alt-naked-expr.rs b/src/test/pretty/alt-naked-expr.rs index 3a92e3c28e7..15c49cd4115 100644 --- a/src/test/pretty/alt-naked-expr.rs +++ b/src/test/pretty/alt-naked-expr.rs @@ -13,5 +13,4 @@ fn main() { let x = Some(3); let y = match x { Some(_) => ~"some(_)", None => ~"none" }; - fail_unless!(y == ~"some(_)"); } diff --git a/src/test/pretty/do1.rs b/src/test/pretty/do1.rs index a9608f2beec..950d7b37aa2 100644 --- a/src/test/pretty/do1.rs +++ b/src/test/pretty/do1.rs @@ -12,4 +12,4 @@ fn f(f: @fn(int)) { f(10) } -fn main() { do f |i| { assert i == 10 } } +fn main() { do f |i| { fail_unless!(i == 10) } } diff --git a/src/test/run-fail/bug-811.rs b/src/test/run-fail/bug-811.rs index 4dada6257d4..d3d13f6b5fe 100644 --- a/src/test/run-fail/bug-811.rs +++ b/src/test/run-fail/bug-811.rs @@ -14,7 +14,10 @@ fn test00_start(ch: chan_t, message: int) { send(ch, message); } type task_id = int; type port_id = int; -enum chan_t = {task: task_id, port: port_id}; +struct chan_t { + task: task_id, + port: port_id, +} fn send(ch: chan_t, data: T) { fail!(); } diff --git a/src/test/run-fail/zip-different-lengths.rs b/src/test/run-fail/zip-different-lengths.rs index 311760b6aa5..5eae7fca821 100644 --- a/src/test/run-fail/zip-different-lengths.rs +++ b/src/test/run-fail/zip-different-lengths.rs @@ -10,7 +10,7 @@ // In this case, the code should compile but // the assert should fail at runtime -// error-pattern:Assertion same_length(chars, ints) failed +// error-pattern:assertion failed extern mod std; use core::vec::{same_length, zip}; diff --git a/src/test/run-pass/arith-2.rs b/src/test/run-pass/arith-2.rs index 658f5d61bb8..3ca889428d7 100644 --- a/src/test/run-pass/arith-2.rs +++ b/src/test/run-pass/arith-2.rs @@ -12,6 +12,6 @@ pub fn main() { let i32_c: int = 0x10101010; - assert (i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3) == - i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3)); + fail_unless!(i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3) == + i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3)); } diff --git a/src/test/run-pass/auto-ref-slice-plus-ref.rs b/src/test/run-pass/auto-ref-slice-plus-ref.rs index eda06709692..ea41a50e382 100644 --- a/src/test/run-pass/auto-ref-slice-plus-ref.rs +++ b/src/test/run-pass/auto-ref-slice-plus-ref.rs @@ -17,13 +17,13 @@ trait MyIter { } impl MyIter for &'self [int] { - pure fn test_imm(&self) { assert self[0] == 1 } - pure fn test_const(&const self) { assert self[0] == 1 } + pure fn test_imm(&self) { fail_unless!(self[0] == 1) } + pure fn test_const(&const self) { fail_unless!(self[0] == 1) } } impl MyIter for &'self str { - pure fn test_imm(&self) { assert *self == "test" } - pure fn test_const(&const self) { assert *self == "test" } + pure fn test_imm(&self) { fail_unless!(*self == "test") } + pure fn test_const(&const self) { fail_unless!(*self == "test") } } pub fn main() { diff --git a/src/test/run-pass/big-literals.rs b/src/test/run-pass/big-literals.rs index 03c6a60016d..5e28f193357 100644 --- a/src/test/run-pass/big-literals.rs +++ b/src/test/run-pass/big-literals.rs @@ -1,3 +1,5 @@ +// xfail-pretty + // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. diff --git a/src/test/run-pass/box-pattern.rs b/src/test/run-pass/box-pattern.rs index ccdaeab3273..fb88fce4232 100644 --- a/src/test/run-pass/box-pattern.rs +++ b/src/test/run-pass/box-pattern.rs @@ -12,7 +12,7 @@ struct Foo {a: int, b: uint} enum bar { u(@Foo), w(int), } pub fn main() { - assert (match u(@Foo{a: 10, b: 40u}) { + fail_unless!(match u(@Foo{a: 10, b: 40u}) { u(@Foo{a: a, b: b}) => { a + (b as int) } _ => { 66 } } == 50); diff --git a/src/test/run-pass/boxed-class-type-substitution.rs b/src/test/run-pass/boxed-class-type-substitution.rs index 025bf8fd9d9..81bd3b6c139 100644 --- a/src/test/run-pass/boxed-class-type-substitution.rs +++ b/src/test/run-pass/boxed-class-type-substitution.rs @@ -11,9 +11,9 @@ // Regression test that rustc doesn't recurse infinitely substituting // the boxed type parameter -type Tree = { - parent: Option, -}; +struct Tree { + parent: Option +} fn empty() -> Tree { fail!() } @@ -27,8 +27,8 @@ fn Box() -> Box { } } -enum layout_data = { +struct LayoutData { box: Option<@Box> -}; +} pub fn main() { } diff --git a/src/test/run-pass/c-stack-returning-int64.rs b/src/test/run-pass/c-stack-returning-int64.rs index 158c18868d6..b23e2147f96 100644 --- a/src/test/run-pass/c-stack-returning-int64.rs +++ b/src/test/run-pass/c-stack-returning-int64.rs @@ -30,7 +30,7 @@ fn atoll(s: ~str) -> i64 { pub fn main() { unsafe { fail_unless!(atol(~"1024") * 10 == atol(~"10240")); - assert (atoll(~"11111111111111111") * 10i64) - == atoll(~"111111111111111110"); + fail_unless!((atoll(~"11111111111111111") * 10i64) + == atoll(~"111111111111111110")); } } diff --git a/src/test/run-pass/cleanup-copy-mode.rs b/src/test/run-pass/cleanup-copy-mode.rs index 74dc2e3a0cf..84bcc663970 100644 --- a/src/test/run-pass/cleanup-copy-mode.rs +++ b/src/test/run-pass/cleanup-copy-mode.rs @@ -12,7 +12,7 @@ fn adder(+x: @int, +y: @int) -> int { return *x + *y; } fn failer() -> @int { fail!(); } pub fn main() { - assert(result::is_err(&task::try(|| { + fail_unless!(result::is_err(&task::try(|| { adder(@2, failer()); () }))); } diff --git a/src/test/run-pass/close-over-big-then-small-data.rs b/src/test/run-pass/close-over-big-then-small-data.rs index 7d8b5707d87..518bc48b8ae 100644 --- a/src/test/run-pass/close-over-big-then-small-data.rs +++ b/src/test/run-pass/close-over-big-then-small-data.rs @@ -12,9 +12,9 @@ // storing closure data (as we used to do), the u64 would // overwrite the u16. -type pair = { +struct Pair { a: A, b: B -}; +} fn f(a: A, b: u16) -> @fn() -> (A, u16) { let result: @fn() -> (A, u16) = || (a, b); diff --git a/src/test/run-pass/const-big-enum.rs b/src/test/run-pass/const-big-enum.rs index aa8dffe8eab..a7d1739a56b 100644 --- a/src/test/run-pass/const-big-enum.rs +++ b/src/test/run-pass/const-big-enum.rs @@ -22,7 +22,7 @@ pub fn main() { _ => fail!() } match Y { - Bar(s) => assert(s == 2654435769), + Bar(s) => fail_unless!(s == 2654435769), _ => fail!() } match Z { diff --git a/src/test/run-pass/const-cast-ptr-int.rs b/src/test/run-pass/const-cast-ptr-int.rs index 559e11efcff..2d7dc349c00 100644 --- a/src/test/run-pass/const-cast-ptr-int.rs +++ b/src/test/run-pass/const-cast-ptr-int.rs @@ -11,5 +11,5 @@ const a: *u8 = 0 as *u8; fn main() { - assert a == ptr::null(); -} \ No newline at end of file + fail_unless!(a == ptr::null()); +} diff --git a/src/test/run-pass/const-cast.rs b/src/test/run-pass/const-cast.rs index 9174b45d100..dca68b4c2a3 100644 --- a/src/test/run-pass/const-cast.rs +++ b/src/test/run-pass/const-cast.rs @@ -16,6 +16,6 @@ const a: &static/int = &10; const b: *int = a as *int; fn main() { - assert x as *libc::c_void == y; - assert a as *int == b; -} \ No newline at end of file + fail_unless!(x as *libc::c_void == y); + fail_unless!(a as *int == b); +} diff --git a/src/test/run-pass/const-cross-crate-const.rs b/src/test/run-pass/const-cross-crate-const.rs index eb3c482737c..a7c30593ecb 100644 --- a/src/test/run-pass/const-cross-crate-const.rs +++ b/src/test/run-pass/const-cross-crate-const.rs @@ -17,9 +17,9 @@ const a: uint = cci_const::uint_val; const b: uint = cci_const::uint_expr + 5; fn main() { - assert a == 12; + fail_unless!(a == 12); let foo2 = a; - assert foo2 == cci_const::uint_val; - assert b == cci_const::uint_expr + 5; - assert foo == cci_const::foopy; + fail_unless!(foo2 == cci_const::uint_val); + fail_unless!(b == cci_const::uint_expr + 5); + fail_unless!(foo == cci_const::foopy); } diff --git a/src/test/run-pass/const-cross-crate-extern.rs b/src/test/run-pass/const-cross-crate-extern.rs index e86118f3c43..e1a4fc634ba 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; const foo: *u8 = bar; fn main() { - assert foo == cci_const::bar; + fail_unless!(foo == cci_const::bar); } diff --git a/src/test/run-pass/const-enum-structlike.rs b/src/test/run-pass/const-enum-structlike.rs index 83d81740759..3faad1fee7e 100644 --- a/src/test/run-pass/const-enum-structlike.rs +++ b/src/test/run-pass/const-enum-structlike.rs @@ -18,6 +18,6 @@ const C: E = S1 { u: 23 }; fn main() { match C { S0 { _ } => fail!(), - S1 { u } => assert u == 23 + S1 { u } => fail_unless!(u == 23) } } diff --git a/src/test/run-pass/const-enum-vec-index.rs b/src/test/run-pass/const-enum-vec-index.rs index bad2b71200c..6dde7cc41ec 100644 --- a/src/test/run-pass/const-enum-vec-index.rs +++ b/src/test/run-pass/const-enum-vec-index.rs @@ -19,7 +19,7 @@ pub fn main() { _ => fail!() } match C1 { - V1(n) => assert(n == 0xDEADBEE), + V1(n) => fail_unless!(n == 0xDEADBEE), _ => fail!() } } diff --git a/src/test/run-pass/const-enum-vec-ptr.rs b/src/test/run-pass/const-enum-vec-ptr.rs index b143e20f624..c4017b549e6 100644 --- a/src/test/run-pass/const-enum-vec-ptr.rs +++ b/src/test/run-pass/const-enum-vec-ptr.rs @@ -13,7 +13,7 @@ const C: &static/[E] = &[V0, V1(0xDEADBEE), V0]; pub fn main() { match C[1] { - V1(n) => assert(n == 0xDEADBEE), + V1(n) => fail_unless!(n == 0xDEADBEE), _ => fail!() } match C[2] { diff --git a/src/test/run-pass/const-enum-vector.rs b/src/test/run-pass/const-enum-vector.rs index 0556bd0ea48..48b3c774e39 100644 --- a/src/test/run-pass/const-enum-vector.rs +++ b/src/test/run-pass/const-enum-vector.rs @@ -13,7 +13,7 @@ const C: [E * 3] = [V0, V1(0xDEADBEE), V0]; pub fn main() { match C[1] { - V1(n) => assert(n == 0xDEADBEE), + V1(n) => fail_unless!(n == 0xDEADBEE), _ => fail!() } match C[2] { diff --git a/src/test/run-pass/const-rec-and-tup.rs b/src/test/run-pass/const-rec-and-tup.rs index f65d3ea5df7..ff1f3338e44 100644 --- a/src/test/run-pass/const-rec-and-tup.rs +++ b/src/test/run-pass/const-rec-and-tup.rs @@ -20,6 +20,6 @@ const y : AnotherPair = AnotherPair{ x: (0xf0f0f0f0_f0f0f0f0, pub fn main() { let (p, _) = y.x; - fail_unless!(p == 0xf0f0f0f0_f0f0f0f0); + fail_unless!(p == - 1085102592571150096); io::println(fmt!("0x%x", p as uint)); } diff --git a/src/test/run-pass/const-str-ptr.rs b/src/test/run-pass/const-str-ptr.rs index 3438e65f05f..d0773a73923 100644 --- a/src/test/run-pass/const-str-ptr.rs +++ b/src/test/run-pass/const-str-ptr.rs @@ -14,9 +14,9 @@ const b: *u8 = c as *u8; fn main() { let foo = &a as *u8; - assert unsafe { str::raw::from_bytes(a) } == ~"hi\x00"; - assert unsafe { str::raw::from_buf(foo) } == ~"hi"; - assert unsafe { str::raw::from_buf(b) } == ~"hi"; - assert unsafe { *b == a[0] }; - assert unsafe { *(&c[0] as *u8) == a[0] }; -} \ No newline at end of file + fail_unless!(unsafe { str::raw::from_bytes(a) } == ~"hi\x00"); + fail_unless!(unsafe { str::raw::from_buf(foo) } == ~"hi"); + fail_unless!(unsafe { str::raw::from_buf(b) } == ~"hi"); + fail_unless!(unsafe { *b == a[0] }); + fail_unless!(unsafe { *(&c[0] as *u8) == a[0] }); +} diff --git a/src/test/run-pass/do-stack.rs b/src/test/run-pass/do-stack.rs index b1113f5ad51..a37c9ec1812 100644 --- a/src/test/run-pass/do-stack.rs +++ b/src/test/run-pass/do-stack.rs @@ -11,5 +11,5 @@ fn f(f: &fn(int)) { f(10) } pub fn main() { - do f() |i| { assert i == 10 } + do f() |i| { fail_unless!(i == 10) } } diff --git a/src/test/run-pass/do1.rs b/src/test/run-pass/do1.rs index a7a34d06f1e..d993bbd2d3c 100644 --- a/src/test/run-pass/do1.rs +++ b/src/test/run-pass/do1.rs @@ -11,5 +11,5 @@ fn f(f: @fn(int)) { f(10) } pub fn main() { - do f() |i| { assert i == 10 } + do f() |i| { fail_unless!(i == 10) } } diff --git a/src/test/run-pass/double-unbox.rs b/src/test/run-pass/double-unbox.rs index 2dc246d6c33..9f4c354b2bf 100644 --- a/src/test/run-pass/double-unbox.rs +++ b/src/test/run-pass/double-unbox.rs @@ -8,9 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -type quux = {bar: int}; +struct Quux { + bar: int +} fn g(i: int) { } -fn f(foo: @@quux) { g(foo.bar); } +fn f(foo: @@Quux) { g(foo.bar); } pub fn main() { } diff --git a/src/test/run-pass/enum-cast.rs b/src/test/run-pass/enum-cast.rs index eed5645776b..ac0bbfda20d 100644 --- a/src/test/run-pass/enum-cast.rs +++ b/src/test/run-pass/enum-cast.rs @@ -20,12 +20,12 @@ fn main () { let a2 = B2 as int; let a3 = A2 as float; let a4 = B2 as float; - assert(c1 == 1); - assert(c2 == 2); - assert(c3 == 1.0); - assert(c4 == 2.0); - assert(a1 == 1); - assert(a2 == 2); - assert(a3 == 1.0); - assert(a4 == 2.0); + fail_unless!(c1 == 1); + fail_unless!(c2 == 2); + fail_unless!(c3 == 1.0); + fail_unless!(c4 == 2.0); + fail_unless!(a1 == 1); + fail_unless!(a2 == 2); + fail_unless!(a3 == 1.0); + fail_unless!(a4 == 2.0); } diff --git a/src/test/run-pass/fn-bare-size.rs b/src/test/run-pass/fn-bare-size.rs index e727dd6e8ab..06ec69624c4 100644 --- a/src/test/run-pass/fn-bare-size.rs +++ b/src/test/run-pass/fn-bare-size.rs @@ -14,6 +14,6 @@ extern mod std; pub fn main() { // Bare functions should just be a pointer - assert sys::rustrt::size_of::() == - sys::rustrt::size_of::(); + fail_unless!(sys::rustrt::size_of::() == + sys::rustrt::size_of::()); } diff --git a/src/test/run-pass/generic-type-synonym.rs b/src/test/run-pass/generic-type-synonym.rs index 662cfa110c4..f481797fb44 100644 --- a/src/test/run-pass/generic-type-synonym.rs +++ b/src/test/run-pass/generic-type-synonym.rs @@ -10,10 +10,12 @@ -type foo = {a: T}; +struct Foo { + a: T +} -type bar = foo; +type Bar = Foo; -fn takebar(b: bar) { } +fn takebar(b: Bar) { } pub fn main() { } diff --git a/src/test/run-pass/getopts_ref.rs b/src/test/run-pass/getopts_ref.rs index ad521276046..83a6a9170cc 100644 --- a/src/test/run-pass/getopts_ref.rs +++ b/src/test/run-pass/getopts_ref.rs @@ -20,7 +20,7 @@ pub fn main() { match getopts(args, opts) { result::Ok(ref m) => - assert !opt_present(m, "b"), + fail_unless!(!opt_present(m, "b")), result::Err(ref f) => fail!(fail_str(copy *f)) }; diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 31812d4637c..d39f02a3574 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -28,11 +28,11 @@ pub mod pipes { terminated } - pub type packet = { + pub struct packet { state: state, blocked_task: Option, payload: Option - }; + } pub fn packet() -> *packet { unsafe { diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index 3340a387a12..9538ebc554c 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -70,14 +70,14 @@ fn read_board_grid(+in: rdr) -> ~[~[square]] { grid.push(row) } let width = grid[0].len(); - for grid.each |row| { assert row.len() == width } + for grid.each |row| { fail_unless!(row.len() == width) } grid } mod test { #[test] pub fn trivial_to_str() { - assert lambda.to_str() == "\\" + fail_unless!(lambda.to_str() == "\\") } #[test] diff --git a/src/test/run-pass/item-attributes.rs b/src/test/run-pass/item-attributes.rs index c3c6b9ebcb9..5de3e88acc0 100644 --- a/src/test/run-pass/item-attributes.rs +++ b/src/test/run-pass/item-attributes.rs @@ -66,7 +66,7 @@ mod test_multi_attr_outer { #[attr1 = "val"] #[attr2 = "val"] - type t = {x: int}; + struct t {x: int} } mod test_stmt_single_attr_outer { diff --git a/src/test/run-pass/macro-2.rs b/src/test/run-pass/macro-2.rs index c280423190f..0606385ed7d 100644 --- a/src/test/run-pass/macro-2.rs +++ b/src/test/run-pass/macro-2.rs @@ -19,5 +19,5 @@ pub fn main() { }) ) - assert(mylambda_tt!(y, y * 2)(8) == 16) + fail_unless!(mylambda_tt!(y, y * 2)(8) == 16) } diff --git a/src/test/run-pass/macro-interpolation.rs b/src/test/run-pass/macro-interpolation.rs index 304e76d0ee4..91410fea16e 100644 --- a/src/test/run-pass/macro-interpolation.rs +++ b/src/test/run-pass/macro-interpolation.rs @@ -23,7 +23,7 @@ macro_rules! overly_complicated ( ) pub fn main() { - fail_unless!(overly_complicated!(f, x, Option, { return Some(x)); }, - Some(8u), Some(y), y) == 8u + fail_unless!(overly_complicated!(f, x, Option, { return Some(x); }, + Some(8u), Some(y), y) == 8u) } diff --git a/src/test/run-pass/monad.rs b/src/test/run-pass/monad.rs index 56de6319649..523348b4ffd 100644 --- a/src/test/run-pass/monad.rs +++ b/src/test/run-pass/monad.rs @@ -42,8 +42,8 @@ fn transform(x: Option) -> Option<~str> { pub fn main() { fail_unless!(transform(Some(10)) == Some(~"11")); fail_unless!(transform(None) == None); - assert (~[~"hi"]) + fail_unless!((~[~"hi"]) .bind(|x| ~[copy *x, *x + ~"!"] ) .bind(|x| ~[copy *x, *x + ~"?"] ) == - ~[~"hi", ~"hi?", ~"hi!", ~"hi!?"]; + ~[~"hi", ~"hi?", ~"hi!", ~"hi!?"]); } diff --git a/src/test/run-pass/morestack3.rs b/src/test/run-pass/morestack3.rs index 78ec8c8037b..de624d22588 100644 --- a/src/test/run-pass/morestack3.rs +++ b/src/test/run-pass/morestack3.rs @@ -47,6 +47,6 @@ fn getbig(a0: int, } pub fn main() { - let a = 10000; + let a = 1000; getbig(a, a+1, a+2, a+3, a+4, a+5, a+6, a+7, a+8, a+9); } diff --git a/src/test/run-pass/numeric-method-autoexport.rs b/src/test/run-pass/numeric-method-autoexport.rs index 766576ffe6a..714852dbb86 100644 --- a/src/test/run-pass/numeric-method-autoexport.rs +++ b/src/test/run-pass/numeric-method-autoexport.rs @@ -1,3 +1,5 @@ +// xfail-pretty + // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. diff --git a/src/test/run-pass/reflect-visit-data.rs b/src/test/run-pass/reflect-visit-data.rs index 852c580667a..029dc37cfb2 100644 --- a/src/test/run-pass/reflect-visit-data.rs +++ b/src/test/run-pass/reflect-visit-data.rs @@ -651,8 +651,8 @@ pub fn main() { io::println(fmt!("val: %s", *s)); } error!("%?", copy u.vals); - assert u.vals == ~[ + fail_unless!(u.vals == ~[ ~"1", ~"2", ~"3", ~"true", ~"false", ~"5", ~"4", ~"3", ~"12" - ]; + ]); } } diff --git a/src/test/run-pass/reflect-visit-type.rs b/src/test/run-pass/reflect-visit-type.rs index 672e87e4f44..6efd40b1fd6 100644 --- a/src/test/run-pass/reflect-visit-type.rs +++ b/src/test/run-pass/reflect-visit-type.rs @@ -153,6 +153,6 @@ pub fn main() { for (copy v.types).each {|s| io::println(fmt!("type: %s", s)); } - assert v.types == ["bool", "int", "i8", "i16", - "[", "int", "]"]; + fail_unless!(v.types == ["bool", "int", "i8", "i16", + "[", "int", "]"]); } diff --git a/src/test/run-pass/regions-addr-of-interior-of-unique-box.rs b/src/test/run-pass/regions-addr-of-interior-of-unique-box.rs index 5a13ae58ae9..40a8b6164dc 100644 --- a/src/test/run-pass/regions-addr-of-interior-of-unique-box.rs +++ b/src/test/run-pass/regions-addr-of-interior-of-unique-box.rs @@ -8,10 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -type point = { x: int, y: int }; -type character = { pos: ~point }; +struct Point { + x: int, + y: int +} -fn get_x(x: &r/character) -> &r/int { +struct Character { + pos: ~Point +} + +fn get_x(x: &'r Character) -> &'r int { // interesting case because the scope of this // borrow of the unique pointer is in fact // larger than the fn itself diff --git a/src/test/run-pass/send-type-inference.rs b/src/test/run-pass/send-type-inference.rs index 0f924df8dc0..734ef70a4b8 100644 --- a/src/test/run-pass/send-type-inference.rs +++ b/src/test/run-pass/send-type-inference.rs @@ -11,9 +11,12 @@ use core::comm::*; // tests that ctrl's type gets inferred properly -type command = {key: K, val: V}; +struct Command { + key: K, + val: V +} -fn cache_server(c: Chan>>) { +fn cache_server(c: Chan>>) { let (ctrl_port, ctrl_chan) = stream(); c.send(ctrl_chan); } diff --git a/src/test/run-pass/syntax-extension-minor.rs b/src/test/run-pass/syntax-extension-minor.rs index b171cdfae8c..419380fba22 100644 --- a/src/test/run-pass/syntax-extension-minor.rs +++ b/src/test/run-pass/syntax-extension-minor.rs @@ -13,6 +13,6 @@ pub fn main() { let asdf_fdsa = ~"<.<"; fail_unless!((concat_idents!(asd, f_f, dsa) == ~"<.<")); - assert (stringify!(use_mention_distinction) == + fail_unless!(stringify!(use_mention_distinction) == ~"use_mention_distinction"); } diff --git a/src/test/run-pass/syntax-extension-source-utils-files/includeme.fragment b/src/test/run-pass/syntax-extension-source-utils-files/includeme.fragment index eca0881deaf..4ff0fc7a9f2 100644 --- a/src/test/run-pass/syntax-extension-source-utils-files/includeme.fragment +++ b/src/test/run-pass/syntax-extension-source-utils-files/includeme.fragment @@ -1,7 +1,7 @@ /* this is for run-pass/syntax-extension-source-utils.rs */ { - assert(file!().ends_with("includeme.fragment")); - assert(line!() == 5u); + fail_unless!(file!().ends_with("includeme.fragment")); + fail_unless!(line!() == 5u); fmt!("victory robot %u", line!()) } diff --git a/src/test/run-pass/syntax-extension-source-utils.rs b/src/test/run-pass/syntax-extension-source-utils.rs index 39480c42e2e..64055f5a88b 100644 --- a/src/test/run-pass/syntax-extension-source-utils.rs +++ b/src/test/run-pass/syntax-extension-source-utils.rs @@ -21,17 +21,17 @@ macro_rules! indirect_line( () => ( line!() ) ) pub fn main() { fail_unless!((line!() == 23)); - fail_unless!((col!() == 11)); + //fail_unless!((col!() == 11)); fail_unless!((indirect_line!() == 25)); fail_unless!((file!().to_owned().ends_with(~"syntax-extension-source-utils.rs"))); fail_unless!((stringify!((2*3) + 5).to_owned() == ~"( 2 * 3 ) + 5")); - assert(include!("syntax-extension-source-utils-files/includeme.fragment").to_owned() + fail_unless!(include!("syntax-extension-source-utils-files/includeme.fragment").to_owned() == ~"victory robot 6"); - assert( + fail_unless!( include_str!("syntax-extension-source-utils-files/includeme.fragment").to_owned() .starts_with(~"/* this is for ")); - assert( + fail_unless!( include_bin!("syntax-extension-source-utils-files/includeme.fragment") [1] == (42 as u8)); // '*' // The Windows tests are wrapped in an extra module for some reason diff --git a/src/test/run-pass/test-ignore-cfg.rs b/src/test/run-pass/test-ignore-cfg.rs index b045dc3074d..ae99aee05d7 100644 --- a/src/test/run-pass/test-ignore-cfg.rs +++ b/src/test/run-pass/test-ignore-cfg.rs @@ -28,11 +28,11 @@ fn checktests() { // Pull the tests out of the secreturn test module let tests = __test::tests; - assert vec::any( + fail_unless!(vec::any( tests, - |t| t.desc.name.to_str() == ~"shouldignore" && t.desc.ignore); + |t| t.desc.name.to_str() == ~"shouldignore" && t.desc.ignore)); - assert vec::any( + fail_unless!(vec::any( tests, - |t| t.desc.name.to_str() == ~"shouldnotignore" && !t.desc.ignore); + |t| t.desc.name.to_str() == ~"shouldnotignore" && !t.desc.ignore)); } diff --git a/src/test/run-pass/trait-inheritance-subst.rs b/src/test/run-pass/trait-inheritance-subst.rs index ea3e75f3551..5900805e957 100644 --- a/src/test/run-pass/trait-inheritance-subst.rs +++ b/src/test/run-pass/trait-inheritance-subst.rs @@ -31,6 +31,6 @@ pure fn mi(v: int) -> MyInt { MyInt { val: v } } pub fn main() { let (x, y) = (mi(3), mi(5)); let z = f(x, y); - assert z.val == 8 + fail_unless!(z.val == 8) } diff --git a/src/test/run-pass/type-params-in-for-each.rs b/src/test/run-pass/type-params-in-for-each.rs index f4ec8b0c9e8..bf252ee1364 100644 --- a/src/test/run-pass/type-params-in-for-each.rs +++ b/src/test/run-pass/type-params-in-for-each.rs @@ -8,14 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - +struct S { + a: T, + b: uint, +} fn range(lo: uint, hi: uint, it: fn(uint)) { let mut lo_ = lo; while lo_ < hi { it(lo_); lo_ += 1u; } } -fn create_index(index: ~[{a: T, b: uint}], hash_fn: extern fn(T) -> uint) { +fn create_index(index: ~[S], hash_fn: extern fn(T) -> uint) { range(0u, 256u, |_i| { let bucket: ~[T] = ~[]; } ) } diff --git a/src/test/run-pass/type-sizes.rs b/src/test/run-pass/type-sizes.rs index bd90277cddd..86c10e0a597 100644 --- a/src/test/run-pass/type-sizes.rs +++ b/src/test/run-pass/type-sizes.rs @@ -22,7 +22,7 @@ pub fn main() { fail_unless!((size_of::<{a: u8, b: i8, c: u8}>() == 3 as uint)); // Alignment causes padding before the char and the u32. - assert (size_of::<{a: u8, b: i8, c: {u: char, v: u8}, d: u32}>() == + fail_unless!(size_of::<{a: u8, b: i8, c: {u: char, v: u8}, d: u32}>() == 16 as uint); fail_unless!((size_of::() == size_of::())); fail_unless!((size_of::<{a: int, b: ()}>() == size_of::())); diff --git a/src/test/run-pass/typeclasses-eq-example-static.rs b/src/test/run-pass/typeclasses-eq-example-static.rs index 6dc43dd892c..1a2250b7691 100644 --- a/src/test/run-pass/typeclasses-eq-example-static.rs +++ b/src/test/run-pass/typeclasses-eq-example-static.rs @@ -55,11 +55,11 @@ pub fn main() { fail_unless!(Equal::isEq(leaf(cyan), leaf(cyan))); fail_unless!(!Equal::isEq(leaf(cyan), leaf(yellow))); - assert Equal::isEq(branch(@leaf(magenta), @leaf(cyan)), - branch(@leaf(magenta), @leaf(cyan))); + fail_unless!(Equal::isEq(branch(@leaf(magenta), @leaf(cyan)), + branch(@leaf(magenta), @leaf(cyan)))); - assert !Equal::isEq(branch(@leaf(magenta), @leaf(cyan)), - branch(@leaf(magenta), @leaf(magenta))); + fail_unless!(!Equal::isEq(branch(@leaf(magenta), @leaf(cyan)), + branch(@leaf(magenta), @leaf(magenta)))); log(error, "Assertions all succeeded!"); } diff --git a/src/test/run-pass/typeclasses-eq-example.rs b/src/test/run-pass/typeclasses-eq-example.rs index df9230a5dae..87a62f81e6d 100644 --- a/src/test/run-pass/typeclasses-eq-example.rs +++ b/src/test/run-pass/typeclasses-eq-example.rs @@ -54,11 +54,11 @@ pub fn main() { fail_unless!(leaf(cyan).isEq(leaf(cyan))); fail_unless!(!leaf(cyan).isEq(leaf(yellow))); - assert branch(@leaf(magenta), @leaf(cyan)) - .isEq(branch(@leaf(magenta), @leaf(cyan))); + fail_unless!(branch(@leaf(magenta), @leaf(cyan)) + .isEq(branch(@leaf(magenta), @leaf(cyan)))); - assert !branch(@leaf(magenta), @leaf(cyan)) - .isEq(branch(@leaf(magenta), @leaf(magenta))); + fail_unless!(!branch(@leaf(magenta), @leaf(cyan)) + .isEq(branch(@leaf(magenta), @leaf(magenta)))); - log(error, "Assertions all succeeded!"); + error!("Assertions all succeeded!"); } diff --git a/src/test/run-pass/unique-in-tag.rs b/src/test/run-pass/unique-in-tag.rs index 6e454d40032..f6f1c3814c6 100644 --- a/src/test/run-pass/unique-in-tag.rs +++ b/src/test/run-pass/unique-in-tag.rs @@ -12,13 +12,13 @@ fn test1() { enum bar { u(~int), w(int), } let x = u(~10); - assert match x { + fail_unless!(match x { u(a) => { log(error, a); *a } _ => { 66 } - } == 10; + } == 10); } pub fn main() { diff --git a/src/test/run-pass/unique-pat-2.rs b/src/test/run-pass/unique-pat-2.rs index 8eb68dacbe3..ef9ed082c00 100644 --- a/src/test/run-pass/unique-pat-2.rs +++ b/src/test/run-pass/unique-pat-2.rs @@ -14,7 +14,7 @@ struct Foo {a: int, b: uint} enum bar { u(~Foo), w(int), } pub fn main() { - assert (match u(~Foo{a: 10, b: 40u}) { + fail_unless!(match u(~Foo{a: 10, b: 40u}) { u(~Foo{a: a, b: b}) => { a + (b as int) } _ => { 66 } } == 50); diff --git a/src/test/run-pass/unique-pat-3.rs b/src/test/run-pass/unique-pat-3.rs index f4e895a0915..61d37842e15 100644 --- a/src/test/run-pass/unique-pat-3.rs +++ b/src/test/run-pass/unique-pat-3.rs @@ -12,11 +12,11 @@ enum bar { u(~int), w(int), } pub fn main() { - assert match u(~10) { + fail_unless!(match u(~10) { u(a) => { log(error, a); *a } _ => { 66 } - } == 10; + } == 10); } diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index 5e3201eae17..a652ed64945 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -61,9 +61,9 @@ fn hammertime() -> int { fn canttouchthis() -> uint { pure fn p() -> bool { true } - let _a = (fail_unless!((true)) == (assert (p()))); + let _a = (fail_unless!((true)) == (fail_unless!(p()))); let _c = (fail_unless!((p())) == ()); - let _b: bool = (log(debug, 0) == (return 0u)); + let _b: bool = (debug!("%d", 0) == (return 0u)); } fn angrydome() { diff --git a/src/test/run-pass/x86stdcall2.rs b/src/test/run-pass/x86stdcall2.rs index e61f512cfcd..672505f6315 100644 --- a/src/test/run-pass/x86stdcall2.rs +++ b/src/test/run-pass/x86stdcall2.rs @@ -8,13 +8,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -type HANDLE = u32; -type DWORD = u32; -type SIZE_T = u32; -type LPVOID = uint; -type BOOL = u8; +pub type HANDLE = u32; +pub type DWORD = u32; +pub type SIZE_T = u32; +pub type LPVOID = uint; +pub type BOOL = u8; mod kernel32 { + use super::{HANDLE, DWORD, SIZE_T, LPVOID, BOOL}; + #[cfg(target_os = "win32")] #[abi = "stdcall"] pub extern {