De-mode vec::each() and many of the str iteration routines
Note that the method foo.each() is not de-moded, nor the other vec routines.
This commit is contained in:
@@ -227,7 +227,7 @@ fn print_failures(st: ConsoleTestState) {
|
||||
let failures = vec::map(failures, |test| test.name);
|
||||
let failures = sort::merge_sort(|x, y| str::le(*x, *y), failures);
|
||||
for vec::each(failures) |name| {
|
||||
st.out.write_line(fmt!(" %s", name));
|
||||
st.out.write_line(fmt!(" %s", *name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -535,30 +535,34 @@ mod tests {
|
||||
~"test::sort_tests"];
|
||||
let tests =
|
||||
{
|
||||
let testfn = fn~() { };
|
||||
let mut tests = ~[];
|
||||
let testfn = fn~() { };
|
||||
let mut tests = ~[];
|
||||
for vec::each(names) |name| {
|
||||
let test = {name: name, testfn: copy testfn, ignore: false,
|
||||
should_fail: false};
|
||||
tests += ~[test];
|
||||
let test = {name: *name, testfn: copy testfn, ignore: false,
|
||||
should_fail: false};
|
||||
vec::push(tests, test);
|
||||
}
|
||||
tests
|
||||
};
|
||||
let filtered = filter_tests(opts, tests);
|
||||
|
||||
let expected =
|
||||
~[~"int::test_pow", ~"int::test_to_str", ~"sha1::test",
|
||||
~"test::do_not_run_ignored_tests",
|
||||
~"test::filter_for_ignored_option",
|
||||
~"test::first_free_arg_should_be_a_filter",
|
||||
~"test::ignored_tests_result_in_ignored",
|
||||
~"test::parse_ignored_flag",
|
||||
~"test::sort_tests"];
|
||||
|
||||
let pairs = vec::zip(expected, filtered);
|
||||
|
||||
for vec::each(pairs) |p| {
|
||||
match *p {
|
||||
(a, b) => { assert (a == b.name); }
|
||||
}
|
||||
}
|
||||
tests
|
||||
};
|
||||
let filtered = filter_tests(opts, tests);
|
||||
|
||||
let expected =
|
||||
~[~"int::test_pow", ~"int::test_to_str", ~"sha1::test",
|
||||
~"test::do_not_run_ignored_tests",
|
||||
~"test::filter_for_ignored_option",
|
||||
~"test::first_free_arg_should_be_a_filter",
|
||||
~"test::ignored_tests_result_in_ignored",
|
||||
~"test::parse_ignored_flag",
|
||||
~"test::sort_tests"];
|
||||
|
||||
let pairs = vec::zip(expected, filtered);
|
||||
|
||||
for vec::each(pairs) |p| { let (a, b) = copy p; assert (a == b.name); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user