Remove variable name 'res' from test suite

This commit is contained in:
Marijn Haverbeke 2011-06-25 17:45:49 +02:00
parent c772269f08
commit 781a265b88
19 changed files with 153 additions and 153 deletions

View File

@ -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;

View File

@ -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;
}
//

View File

@ -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);
}

View File

@ -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); }
fn main() { auto pth = fail"bye"; let rec(str t) rs = rec(t=pth); }

View File

@ -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;
}

View File

@ -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(); }

View File

@ -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(); }

View File

@ -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() {

View File

@ -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(); }

View File

@ -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(); }

View File

@ -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(); }

View File

@ -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(); }

View File

@ -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() {

View File

@ -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");

View File

@ -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() {

View File

@ -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

View File

@ -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)));

View File

@ -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);
}

View File

@ -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); }