diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-03-06 19:09:17 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-03-07 22:37:58 -0800 |
| commit | d661711cc2fb1365ad9f25cbabe3c34550eaafbe (patch) | |
| tree | 569597677a7b99ed9435df0c0253c7300ccf24d6 /src/libcore/str.rs | |
| parent | 9a17ef9b5285bff753e4585f74beebd6fb3cf415 (diff) | |
| download | rust-d661711cc2fb1365ad9f25cbabe3c34550eaafbe.tar.gz rust-d661711cc2fb1365ad9f25cbabe3c34550eaafbe.zip | |
test: Fix tests.
Diffstat (limited to 'src/libcore/str.rs')
| -rw-r--r-- | src/libcore/str.rs | 29 |
1 files changed, 19 insertions, 10 deletions
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)); } |
