From 781a265b88f7fc3c8c406b327e8a548e742d6224 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Sat, 25 Jun 2011 17:45:49 +0200 Subject: [PATCH] Remove variable name 'res' from test suite --- src/comp/middle/tstate/states.rs | 6 +- src/comp/middle/tstate/tritv.rs | 6 +- src/test/compile-fail/break-outside-loop.rs | 2 +- src/test/run-fail/rhs-type.rs | 2 +- src/test/run-pass/alt-join.rs | 4 +- src/test/run-pass/expr-alt-box.rs | 8 +- src/test/run-pass/expr-alt-struct.rs | 8 +- src/test/run-pass/expr-alt.rs | 20 +-- src/test/run-pass/expr-block-fn.rs | 4 +- src/test/run-pass/expr-block.rs | 8 +- src/test/run-pass/expr-if-box.rs | 8 +- src/test/run-pass/expr-if-struct.rs | 8 +- src/test/run-pass/expr-if.rs | 36 ++--- src/test/run-pass/lib-getopts.rs | 140 ++++++++++---------- src/test/run-pass/lib-list.rs | 12 +- src/test/run-pass/lib-sha1.rs | 6 +- src/test/run-pass/lib-str.rs | 12 +- src/test/run-pass/obj-self-4.rs | 14 +- src/test/run-pass/tail-cps.rs | 2 +- 19 files changed, 153 insertions(+), 153 deletions(-) diff --git a/src/comp/middle/tstate/states.rs b/src/comp/middle/tstate/states.rs index 673186e4415..8af52ed83a0 100644 --- a/src/comp/middle/tstate/states.rs +++ b/src/comp/middle/tstate/states.rs @@ -171,8 +171,8 @@ fn find_pre_post_state_call(&fn_ctxt fcx, &prestate pres, &@expr a, fn find_pre_post_state_exprs(&fn_ctxt fcx, &prestate pres, ast::node_id id, &vec[@expr] es, controlflow cf) -> bool { - auto res = seq_states(fcx, pres, es); - auto changed = res._0; + auto rs = seq_states(fcx, pres, es); + auto changed = rs._0; changed = set_prestate_ann(fcx.ccx, id, pres) || changed; /* if this is a failing call, it sets everything as initialized */ alt (cf) { @@ -183,7 +183,7 @@ fn find_pre_post_state_exprs(&fn_ctxt fcx, &prestate pres, ast::node_id id, changed; } case (_) { - changed = set_poststate_ann(fcx.ccx, id, res._1) || changed; + changed = set_poststate_ann(fcx.ccx, id, rs._1) || changed; } } ret changed; diff --git a/src/comp/middle/tstate/tritv.rs b/src/comp/middle/tstate/tritv.rs index aa7ee64b395..88bc74772b4 100644 --- a/src/comp/middle/tstate/tritv.rs +++ b/src/comp/middle/tstate/tritv.rs @@ -241,15 +241,15 @@ fn to_vec(&t v) -> vec[uint] { fn to_str(&t v) -> str { let uint i = 0u; - let str res = ""; + let str rs = ""; while (i < v.nbits) { - res += alt (tritv_get(v, i)) { + rs += alt (tritv_get(v, i)) { case (dont_care) { "?" } case (ttrue) { "1" } case (tfalse) { "0" } }; i += 1u; } - ret res; + ret rs; } // diff --git a/src/test/compile-fail/break-outside-loop.rs b/src/test/compile-fail/break-outside-loop.rs index 42e8cc8908a..bc40a508a08 100644 --- a/src/test/compile-fail/break-outside-loop.rs +++ b/src/test/compile-fail/break-outside-loop.rs @@ -3,6 +3,6 @@ fn main() { auto pth = break; - let rec(str t) res = rec(t=pth); + let rec(str t) rs = rec(t=pth); } \ No newline at end of file diff --git a/src/test/run-fail/rhs-type.rs b/src/test/run-fail/rhs-type.rs index 318a9eb5786..9947ec70109 100644 --- a/src/test/run-fail/rhs-type.rs +++ b/src/test/run-fail/rhs-type.rs @@ -5,4 +5,4 @@ // as a _|_-typed thing, not a str-typed thing // xfail-stage0 // error-pattern:bye -fn main() { auto pth = fail"bye"; let rec(str t) res = rec(t=pth); } \ No newline at end of file +fn main() { auto pth = fail"bye"; let rec(str t) rs = rec(t=pth); } \ No newline at end of file diff --git a/src/test/run-pass/alt-join.rs b/src/test/run-pass/alt-join.rs index 73db771c364..e2aa0f26c65 100644 --- a/src/test/run-pass/alt-join.rs +++ b/src/test/run-pass/alt-join.rs @@ -7,14 +7,14 @@ import std::option::some; fn foo[T](&option::t[T] y) { let int x; - let vec[int] res = []; + let vec[int] rs = []; /* tests that x doesn't get put in the precondition for the entire if expression */ if (true) { } else { alt (y) { case (none[T]) { x = 17; } case (_) { x = 42; } } - res += [x]; + rs += [x]; } ret; } diff --git a/src/test/run-pass/expr-alt-box.rs b/src/test/run-pass/expr-alt-box.rs index 52868f431a4..ec8b88f7708 100644 --- a/src/test/run-pass/expr-alt-box.rs +++ b/src/test/run-pass/expr-alt-box.rs @@ -5,13 +5,13 @@ // Tests for alt as expressions resulting in boxed types fn test_box() { - auto res = alt (true) { case (true) { @100 } }; - assert (*res == 100); + auto rs = alt (true) { case (true) { @100 } }; + assert (*rs == 100); } fn test_str() { - auto res = alt (true) { case (true) { "happy" } }; - assert (res == "happy"); + auto rs = alt (true) { case (true) { "happy" } }; + assert (rs == "happy"); } fn main() { test_box(); test_str(); } \ No newline at end of file diff --git a/src/test/run-pass/expr-alt-struct.rs b/src/test/run-pass/expr-alt-struct.rs index 7802834b3a7..ae318c52e4a 100644 --- a/src/test/run-pass/expr-alt-struct.rs +++ b/src/test/run-pass/expr-alt-struct.rs @@ -5,14 +5,14 @@ // Tests for alt as expressions resulting in structural types fn test_rec() { - auto res = alt (true) { case (true) { rec(i=100) } }; - assert (res == rec(i=100)); + auto rs = alt (true) { case (true) { rec(i=100) } }; + assert (rs == rec(i=100)); } fn test_tag() { tag mood { happy; sad; } - auto res = alt (true) { case (true) { happy } case (false) { sad } }; - assert (res == happy); + auto rs = alt (true) { case (true) { happy } case (false) { sad } }; + assert (rs == happy); } fn main() { test_rec(); test_tag(); } \ No newline at end of file diff --git a/src/test/run-pass/expr-alt.rs b/src/test/run-pass/expr-alt.rs index ace0d372011..a401e2df7d3 100644 --- a/src/test/run-pass/expr-alt.rs +++ b/src/test/run-pass/expr-alt.rs @@ -5,37 +5,37 @@ // Tests for using alt as an expression fn test_basic() { - let bool res = alt (true) { case (true) { true } case (false) { false } }; - assert (res); - res = alt (false) { case (true) { false } case (false) { true } }; - assert (res); + let bool rs = alt (true) { case (true) { true } case (false) { false } }; + assert (rs); + rs = alt (false) { case (true) { false } case (false) { true } }; + assert (rs); } fn test_inferrence() { - auto res = alt (true) { case (true) { true } case (false) { false } }; - assert (res); + auto rs = alt (true) { case (true) { true } case (false) { false } }; + assert (rs); } fn test_alt_as_alt_head() { // Yeah, this is kind of confusing ... - auto res = + auto rs = alt (alt (false) { case (true) { true } case (false) { false } }) { case (true) { false } case (false) { true } }; - assert (res); + assert (rs); } fn test_alt_as_block_result() { - auto res = + auto rs = alt (false) { case (true) { false } case (false) { alt (true) { case (true) { true } case (false) { false } } } }; - assert (res); + assert (rs); } fn main() { diff --git a/src/test/run-pass/expr-block-fn.rs b/src/test/run-pass/expr-block-fn.rs index d7ac6ee489b..d2682da289d 100644 --- a/src/test/run-pass/expr-block-fn.rs +++ b/src/test/run-pass/expr-block-fn.rs @@ -4,8 +4,8 @@ fn test_fn() { type t = fn() -> int ; fn ten() -> int { ret 10; } - let t res = { ten }; - assert (res() == 10); + let t rs = { ten }; + assert (rs() == 10); } fn main() { test_fn(); } \ No newline at end of file diff --git a/src/test/run-pass/expr-block.rs b/src/test/run-pass/expr-block.rs index cb87ae862d4..b11a1254efc 100644 --- a/src/test/run-pass/expr-block.rs +++ b/src/test/run-pass/expr-block.rs @@ -4,13 +4,13 @@ // -*- rust -*- // Tests for standalone blocks as expressions -fn test_basic() { let bool res = { true }; assert (res); } +fn test_basic() { let bool rs = { true }; assert (rs); } -fn test_rec() { auto res = { rec(v1=10, v2=20) }; assert (res.v2 == 20); } +fn test_rec() { auto rs = { rec(v1=10, v2=20) }; assert (rs.v2 == 20); } fn test_filled_with_stuff() { - auto res = { auto a = 0; while (a < 10) { a += 1; } a }; - assert (res == 10); + auto rs = { auto a = 0; while (a < 10) { a += 1; } a }; + assert (rs == 10); } fn main() { test_basic(); test_rec(); test_filled_with_stuff(); } \ No newline at end of file diff --git a/src/test/run-pass/expr-if-box.rs b/src/test/run-pass/expr-if-box.rs index 9bb7713757e..fd63eb9c6e6 100644 --- a/src/test/run-pass/expr-if-box.rs +++ b/src/test/run-pass/expr-if-box.rs @@ -5,13 +5,13 @@ // Tests for if as expressions returning boxed types fn test_box() { - auto res = if (true) { @100 } else { @101 }; - assert (*res == 100); + auto rs = if (true) { @100 } else { @101 }; + assert (*rs == 100); } fn test_str() { - auto res = if (true) { "happy" } else { "sad" }; - assert (res == "happy"); + auto rs = if (true) { "happy" } else { "sad" }; + assert (rs == "happy"); } fn main() { test_box(); test_str(); } \ No newline at end of file diff --git a/src/test/run-pass/expr-if-struct.rs b/src/test/run-pass/expr-if-struct.rs index 4020ba3d13b..824f72f0ba6 100644 --- a/src/test/run-pass/expr-if-struct.rs +++ b/src/test/run-pass/expr-if-struct.rs @@ -5,14 +5,14 @@ // Tests for if as expressions returning structural types fn test_rec() { - auto res = if (true) { rec(i=100) } else { rec(i=101) }; - assert (res == rec(i=100)); + auto rs = if (true) { rec(i=100) } else { rec(i=101) }; + assert (rs == rec(i=100)); } fn test_tag() { tag mood { happy; sad; } - auto res = if (true) { happy } else { sad }; - assert (res == happy); + auto rs = if (true) { happy } else { sad }; + assert (rs == happy); } fn main() { test_rec(); test_tag(); } \ No newline at end of file diff --git a/src/test/run-pass/expr-if.rs b/src/test/run-pass/expr-if.rs index f728daaedfd..e4069024815 100644 --- a/src/test/run-pass/expr-if.rs +++ b/src/test/run-pass/expr-if.rs @@ -5,50 +5,50 @@ // Tests for if as expressions fn test_if() { - let bool res = if (true) { true } else { false }; - assert (res); + let bool rs = if (true) { true } else { false }; + assert (rs); } fn test_else() { - let bool res = if (false) { false } else { true }; - assert (res); + let bool rs = if (false) { false } else { true }; + assert (rs); } fn test_elseif1() { - let bool res = if (true) { true } else if (true) { false } else { false }; - assert (res); + let bool rs = if (true) { true } else if (true) { false } else { false }; + assert (rs); } fn test_elseif2() { - let bool res = + let bool rs = if (false) { false } else if (true) { true } else { false }; - assert (res); + assert (rs); } fn test_elseif3() { - let bool res = + let bool rs = if (false) { false } else if (false) { false } else { true }; - assert (res); + assert (rs); } fn test_inferrence() { - auto res = if (true) { true } else { false }; - assert (res); + auto rs = if (true) { true } else { false }; + assert (rs); } fn test_if_as_if_condition() { - auto res1 = + auto rs1 = if (if (false) { false } else { true }) { true } else { false }; - assert (res1); - auto res2 = + assert (rs1); + auto rs2 = if (if (true) { false } else { true }) { false } else { true }; - assert (res2); + assert (rs2); } fn test_if_as_block_result() { - auto res = + auto rs = if (true) { if (false) { false } else { true } } else { false }; - assert (res); + assert (rs); } fn main() { diff --git a/src/test/run-pass/lib-getopts.rs b/src/test/run-pass/lib-getopts.rs index d044ae0f648..26d253e1d40 100644 --- a/src/test/run-pass/lib-getopts.rs +++ b/src/test/run-pass/lib-getopts.rs @@ -32,8 +32,8 @@ fn check_fail_type(opt::fail_ f, fail_type ft) { fn test_reqopt_long() { auto args = ["--test=20"]; auto opts = [opt::reqopt("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (opt::opt_present(m, "test")); assert (opt::opt_str(m, "test") == "20"); @@ -45,8 +45,8 @@ fn test_reqopt_long() { fn test_reqopt_long_missing() { auto args = ["blah"]; auto opts = [opt::reqopt("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, option_missing); } case (_) { fail; } } @@ -55,8 +55,8 @@ fn test_reqopt_long_missing() { fn test_reqopt_long_no_arg() { auto args = ["--test"]; auto opts = [opt::reqopt("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, argument_missing); } case (_) { fail; } } @@ -65,8 +65,8 @@ fn test_reqopt_long_no_arg() { fn test_reqopt_long_multi() { auto args = ["--test=20", "--test=30"]; auto opts = [opt::reqopt("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, option_duplicated); } case (_) { fail; } } @@ -75,8 +75,8 @@ fn test_reqopt_long_multi() { fn test_reqopt_short() { auto args = ["-t", "20"]; auto opts = [opt::reqopt("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (opt::opt_present(m, "t")); assert (opt::opt_str(m, "t") == "20"); @@ -88,8 +88,8 @@ fn test_reqopt_short() { fn test_reqopt_short_missing() { auto args = ["blah"]; auto opts = [opt::reqopt("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, option_missing); } case (_) { fail; } } @@ -98,8 +98,8 @@ fn test_reqopt_short_missing() { fn test_reqopt_short_no_arg() { auto args = ["-t"]; auto opts = [opt::reqopt("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, argument_missing); } case (_) { fail; } } @@ -108,8 +108,8 @@ fn test_reqopt_short_no_arg() { fn test_reqopt_short_multi() { auto args = ["-t", "20", "-t", "30"]; auto opts = [opt::reqopt("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, option_duplicated); } case (_) { fail; } } @@ -120,8 +120,8 @@ fn test_reqopt_short_multi() { fn test_optopt_long() { auto args = ["--test=20"]; auto opts = [opt::optopt("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (opt::opt_present(m, "test")); assert (opt::opt_str(m, "test") == "20"); @@ -133,8 +133,8 @@ fn test_optopt_long() { fn test_optopt_long_missing() { auto args = ["blah"]; auto opts = [opt::optopt("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (!opt::opt_present(m, "test")); } case (_) { fail; } } @@ -143,8 +143,8 @@ fn test_optopt_long_missing() { fn test_optopt_long_no_arg() { auto args = ["--test"]; auto opts = [opt::optopt("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, argument_missing); } case (_) { fail; } } @@ -153,8 +153,8 @@ fn test_optopt_long_no_arg() { fn test_optopt_long_multi() { auto args = ["--test=20", "--test=30"]; auto opts = [opt::optopt("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, option_duplicated); } case (_) { fail; } } @@ -163,8 +163,8 @@ fn test_optopt_long_multi() { fn test_optopt_short() { auto args = ["-t", "20"]; auto opts = [opt::optopt("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (opt::opt_present(m, "t")); assert (opt::opt_str(m, "t") == "20"); @@ -176,8 +176,8 @@ fn test_optopt_short() { fn test_optopt_short_missing() { auto args = ["blah"]; auto opts = [opt::optopt("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (!opt::opt_present(m, "t")); } case (_) { fail; } } @@ -186,8 +186,8 @@ fn test_optopt_short_missing() { fn test_optopt_short_no_arg() { auto args = ["-t"]; auto opts = [opt::optopt("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, argument_missing); } case (_) { fail; } } @@ -196,8 +196,8 @@ fn test_optopt_short_no_arg() { fn test_optopt_short_multi() { auto args = ["-t", "20", "-t", "30"]; auto opts = [opt::optopt("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, option_duplicated); } case (_) { fail; } } @@ -208,8 +208,8 @@ fn test_optopt_short_multi() { fn test_optflag_long() { auto args = ["--test"]; auto opts = [opt::optflag("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (opt::opt_present(m, "test")); } case (_) { fail; } } @@ -218,8 +218,8 @@ fn test_optflag_long() { fn test_optflag_long_missing() { auto args = ["blah"]; auto opts = [opt::optflag("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (!opt::opt_present(m, "test")); } case (_) { fail; } } @@ -228,8 +228,8 @@ fn test_optflag_long_missing() { fn test_optflag_long_arg() { auto args = ["--test=20"]; auto opts = [opt::optflag("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { log_err opt::fail_str(f); check_fail_type(f, unexpected_argument); @@ -241,8 +241,8 @@ fn test_optflag_long_arg() { fn test_optflag_long_multi() { auto args = ["--test", "--test"]; auto opts = [opt::optflag("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, option_duplicated); } case (_) { fail; } } @@ -251,8 +251,8 @@ fn test_optflag_long_multi() { fn test_optflag_short() { auto args = ["-t"]; auto opts = [opt::optflag("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (opt::opt_present(m, "t")); } case (_) { fail; } } @@ -261,8 +261,8 @@ fn test_optflag_short() { fn test_optflag_short_missing() { auto args = ["blah"]; auto opts = [opt::optflag("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (!opt::opt_present(m, "t")); } case (_) { fail; } } @@ -271,8 +271,8 @@ fn test_optflag_short_missing() { fn test_optflag_short_arg() { auto args = ["-t", "20"]; auto opts = [opt::optflag("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { // The next variable after the flag is just a free argument @@ -285,8 +285,8 @@ fn test_optflag_short_arg() { fn test_optflag_short_multi() { auto args = ["-t", "-t"]; auto opts = [opt::optflag("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, option_duplicated); } case (_) { fail; } } @@ -297,8 +297,8 @@ fn test_optflag_short_multi() { fn test_optmulti_long() { auto args = ["--test=20"]; auto opts = [opt::optmulti("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (opt::opt_present(m, "test")); assert (opt::opt_str(m, "test") == "20"); @@ -310,8 +310,8 @@ fn test_optmulti_long() { fn test_optmulti_long_missing() { auto args = ["blah"]; auto opts = [opt::optmulti("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (!opt::opt_present(m, "test")); } case (_) { fail; } } @@ -320,8 +320,8 @@ fn test_optmulti_long_missing() { fn test_optmulti_long_no_arg() { auto args = ["--test"]; auto opts = [opt::optmulti("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, argument_missing); } case (_) { fail; } } @@ -330,8 +330,8 @@ fn test_optmulti_long_no_arg() { fn test_optmulti_long_multi() { auto args = ["--test=20", "--test=30"]; auto opts = [opt::optmulti("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (opt::opt_present(m, "test")); assert (opt::opt_str(m, "test") == "20"); @@ -345,8 +345,8 @@ fn test_optmulti_long_multi() { fn test_optmulti_short() { auto args = ["-t", "20"]; auto opts = [opt::optmulti("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (opt::opt_present(m, "t")); assert (opt::opt_str(m, "t") == "20"); @@ -358,8 +358,8 @@ fn test_optmulti_short() { fn test_optmulti_short_missing() { auto args = ["blah"]; auto opts = [opt::optmulti("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (!opt::opt_present(m, "t")); } case (_) { fail; } } @@ -368,8 +368,8 @@ fn test_optmulti_short_missing() { fn test_optmulti_short_no_arg() { auto args = ["-t"]; auto opts = [opt::optmulti("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, argument_missing); } case (_) { fail; } } @@ -378,8 +378,8 @@ fn test_optmulti_short_no_arg() { fn test_optmulti_short_multi() { auto args = ["-t", "20", "-t", "30"]; auto opts = [opt::optmulti("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (opt::opt_present(m, "t")); assert (opt::opt_str(m, "t") == "20"); @@ -393,8 +393,8 @@ fn test_optmulti_short_multi() { fn test_unrecognized_option_long() { auto args = ["--untest"]; auto opts = [opt::optmulti("t")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, unrecognized_option); } case (_) { fail; } } @@ -403,8 +403,8 @@ fn test_unrecognized_option_long() { fn test_unrecognized_option_short() { auto args = ["-t"]; auto opts = [opt::optmulti("test")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::failure(?f)) { check_fail_type(f, unrecognized_option); } case (_) { fail; } } @@ -417,8 +417,8 @@ fn test_combined() { auto opts = [opt::optopt("s"), opt::optflag("flag"), opt::reqopt("long"), opt::optflag("f"), opt::optmulti("m"), opt::optopt("notpresent")]; - auto res = opt::getopts(args, opts); - alt (res) { + auto rs = opt::getopts(args, opts); + alt (rs) { case (opt::success(?m)) { assert (m.free.(0) == "prog"); assert (m.free.(1) == "free1"); diff --git a/src/test/run-pass/lib-list.rs b/src/test/run-pass/lib-list.rs index dc68fefddf3..d09243e98e6 100644 --- a/src/test/run-pass/lib-list.rs +++ b/src/test/run-pass/lib-list.rs @@ -16,8 +16,8 @@ fn test_from_vec() { fn test_foldl() { auto l = from_vec([0, 1, 2, 3, 4]); fn add(&int a, &uint b) -> uint { ret (a as uint) + b; } - auto res = list::foldl(l, 0u, add); - assert (res == 10u); + auto rs = list::foldl(l, 0u, add); + assert (rs == 10u); } fn test_find_success() { @@ -25,15 +25,15 @@ fn test_find_success() { fn match(&int i) -> option::t[int] { ret if (i == 2) { option::some(i) } else { option::none[int] }; } - auto res = list::find(l, match); - assert (res == option::some(2)); + auto rs = list::find(l, match); + assert (rs == option::some(2)); } fn test_find_fail() { auto l = from_vec([0, 1, 2]); fn match(&int i) -> option::t[int] { ret option::none[int]; } - auto res = list::find(l, match); - assert (res == option::none[int]); + auto rs = list::find(l, match); + assert (rs == option::none[int]); } fn test_has() { diff --git a/src/test/run-pass/lib-sha1.rs b/src/test/run-pass/lib-sha1.rs index 0af2b85ef80..bfb59453eb1 100644 --- a/src/test/run-pass/lib-sha1.rs +++ b/src/test/run-pass/lib-sha1.rs @@ -13,9 +13,9 @@ fn main() { fn a_million_letter_a() -> str { auto i = 0; - auto res = ""; - while (i < 100000) { res += "aaaaaaaaaa"; i += 1; } - ret res; + auto rs = ""; + while (i < 100000) { rs += "aaaaaaaaaa"; i += 1; } + ret rs; } // Test messages from FIPS 180-1 diff --git a/src/test/run-pass/lib-str.rs b/src/test/run-pass/lib-str.rs index 97ed9169763..0160f0f1d3c 100644 --- a/src/test/run-pass/lib-str.rs +++ b/src/test/run-pass/lib-str.rs @@ -100,15 +100,15 @@ fn test_slice() { assert (str::eq("", str::slice("abc", 1u, 1u))); fn a_million_letter_a() -> str { auto i = 0; - auto res = ""; - while (i < 100000) { res += "aaaaaaaaaa"; i += 1; } - ret res; + auto rs = ""; + while (i < 100000) { rs += "aaaaaaaaaa"; i += 1; } + ret rs; } fn half_a_million_letter_a() -> str { auto i = 0; - auto res = ""; - while (i < 100000) { res += "aaaaa"; i += 1; } - ret res; + auto rs = ""; + while (i < 100000) { rs += "aaaaa"; i += 1; } + ret rs; } assert (str::eq(half_a_million_letter_a(), str::slice(a_million_letter_a(), 0u, 500000u))); diff --git a/src/test/run-pass/obj-self-4.rs b/src/test/run-pass/obj-self-4.rs index bbf840ada54..c57f9e571cc 100644 --- a/src/test/run-pass/obj-self-4.rs +++ b/src/test/run-pass/obj-self-4.rs @@ -15,12 +15,12 @@ fn main() { // } fn get() -> int { ret i; } } - let int res; + let int rs; auto o = foo(5); - res = o.get(); - assert (res == 5); - res = o.inc_by(3); - assert (res == 8); - res = o.get(); - assert (res == 8); + rs = o.get(); + assert (rs == 5); + rs = o.inc_by(3); + assert (rs == 8); + rs = o.get(); + assert (rs == 8); } \ No newline at end of file diff --git a/src/test/run-pass/tail-cps.rs b/src/test/run-pass/tail-cps.rs index 595e7a0549c..37fb22a32d7 100644 --- a/src/test/run-pass/tail-cps.rs +++ b/src/test/run-pass/tail-cps.rs @@ -2,7 +2,7 @@ // -*- rust -*- -fn checktrue(bool res) -> bool { assert (res); ret true; } +fn checktrue(bool rs) -> bool { assert (rs); ret true; } fn main() { auto k = checktrue; evenk(42, k); oddk(45, k); }