Make a bunch of tests stop using the deprecated vector syntax.

This commit is contained in:
Michael Sullivan 2012-06-28 17:31:05 -07:00
parent c9e8b7de82
commit e7760470b4
35 changed files with 63 additions and 63 deletions

View file

@ -1,8 +1,8 @@
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "10000000"]
["", "10000000"]/~
} else if args.len() <= 1u {
["", "100000"]
["", "100000"]/~
} else {
args
};

View file

@ -22,9 +22,9 @@ fn collect_dvec(num: uint) -> [mut uint]/~ {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "50000000"]
["", "50000000"]/~
} else if args.len() <= 1u {
["", "100000"]
["", "100000"]/~
} else {
args
};

View file

@ -373,9 +373,9 @@ fn validate(edges: [(node_id, node_id)]/~,
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "15", "48"]
["", "15", "48"]/~
} else if args.len() <= 1u {
["", "10", "16"]
["", "10", "16"]/~
} else {
args
};

View file

@ -23,9 +23,9 @@ fn thread_ring(i: uint,
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "100", "10000"]
["", "100", "10000"]/~
} else if args.len() <= 1u {
["", "100", "1000"]
["", "100", "1000"]/~
} else {
args
};

View file

@ -23,9 +23,9 @@ fn thread_ring(i: uint,
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "100", "10000"]
["", "100", "10000"]/~
} else if args.len() <= 1u {
["", "100", "1000"]
["", "100", "1000"]/~
} else {
args
};

View file

@ -60,9 +60,9 @@ fn run(args: [str]/~) {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "1000000", "10000"]
["", "1000000", "10000"]/~
} else if args.len() <= 1u {
["", "10000", "4"]
["", "10000", "4"]/~
} else {
args
};

View file

@ -14,9 +14,9 @@ fn ack(m: int, n: int) -> int {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "12"]
["", "12"]/~
} else if args.len() <= 1u {
["", "8"]
["", "8"]/~
} else {
args
};

View file

@ -24,9 +24,9 @@ fn bottom_up_tree(arena: &a.arena::arena, item: int, depth: int) -> &a.tree {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "17"]
["", "17"]/~
} else if args.len() <= 1u {
["", "8"]
["", "8"]/~
} else {
args
};

View file

@ -60,9 +60,9 @@ fn fannkuch(n: int) -> int {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "10"]
["", "10"]/~
} else if args.len() <= 1u {
["", "8"]
["", "8"]/~
} else {
args
};

View file

@ -77,9 +77,9 @@ fn acid(ch: char, prob: u32) -> aminoacids { ret {ch: ch, prob: prob}; }
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
// alioth tests k-nucleotide with this data at 25,000,000
["", "5000000"]
["", "5000000"]/~
} else if args.len() <= 1u {
["", "1000"]
["", "1000"]/~
} else {
args
};

View file

@ -10,9 +10,9 @@ fn fib(n: int) -> int {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "40"]
["", "40"]/~
} else if args.len() <= 1u {
["", "30"]
["", "30"]/~
} else {
args
};

View file

@ -187,7 +187,7 @@ fn main(args: [str]/~) {
// finish...
for sizes.eachi { |ii, _sz|
comm::send(to_child[ii], []);
comm::send(to_child[ii], []/~);
}
// now fetch and print result messages

View file

@ -142,7 +142,7 @@ fn writer(path: str, writech: comm::chan<comm::chan<line>>, size: uint)
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "4000", "10"]
["", "4000", "10"]/~
} else {
args
};

View file

@ -15,9 +15,9 @@ native mod libc {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "4000000"]
["", "4000000"]/~
} else if args.len() <= 1u {
["", "100000"]
["", "100000"]/~
} else {
args
};

View file

@ -80,9 +80,9 @@ fn stress(num_tasks: int) {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "20"]
["", "20"]/~
} else if args.len() <= 1u {
["", "8"]
["", "8"]/~
} else {
args
};

View file

@ -42,9 +42,9 @@ fn eval_AtA_times_u(u: [const float]/~, AtAu: [mut float]/~) {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "2000"]
["", "2000"]/~
} else if args.len() <= 1u {
["", "1000"]
["", "1000"]/~
} else {
args
};

View file

@ -39,9 +39,9 @@ fn roundtrip(id: int, p: comm::port<int>, ch: comm::chan<int>) {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "2000000"]
["", "2000000"]/~
} else if args.len() <= 1u {
["", "1000"]
["", "1000"]/~
} else {
args
};

View file

@ -19,9 +19,9 @@ fn check_sequential(min: uint, max: uint, map: smallintmap<uint>) {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "100000", "100"]
["", "100000", "100"]/~
} else if args.len() <= 1u {
["", "10000", "50"]
["", "10000", "50"]/~
} else {
args
};

View file

@ -47,9 +47,9 @@ fn calc(children: uint, parent_ch: comm::chan<msg>) {
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "100000"]
["", "100000"]/~
} else if args.len() <= 1u {
["", "100"]
["", "100"]/~
} else {
args
};

View file

@ -10,9 +10,9 @@ fn g() { }
fn main(args: [str]/~) {
let args = if os::getenv("RUST_BENCH").is_some() {
["", "400"]
["", "400"]/~
} else if args.len() <= 1u {
["", "10"]
["", "10"]/~
} else {
args
};

View file

@ -18,8 +18,8 @@ fn main() {
let map = map::hashmap(hash, eq);
let mut arr = []/~;
for uint::range(0u, 10u) {|i|
arr += [@"key stuff"];
map.insert(arr, arr + [@"value stuff"]);
arr += [@"key stuff"]/~;
map.insert(arr, arr + [@"value stuff"]/~);
}
map.insert([@"boom"], []);
map.insert([@"boom"]/~, []/~);
}

View file

@ -1,5 +1,5 @@
fn main(args: [str]/~) {
let vs: [str] = ["hi", "there", "this", "is", "a", "vec"];
let vs: [str]/~ = ["hi", "there", "this", "is", "a", "vec"]/~;
let vvs: [[str]/~]/~ = [args, vs]/~;
for vvs.each {|vs| for vs.each {|s| log(debug, s); } }
}

View file

@ -5,5 +5,5 @@ fn g(act: fn([int]/~) -> int) -> int { ret act([1, 2, 3]/~); }
fn main() {
assert (g(f) == 1);
let f1: fn([str]/~) -> str = f;
assert (f1(["x", "y", "z"]) == "x");
assert (f1(["x", "y", "z"]/~) == "x");
}

View file

@ -5,11 +5,11 @@ import cci_class_6::kitties::*;
fn main() {
let nyan : cat<char> = cat::<char>(52u, 99, ['p']/~);
let kitty = cat(1000u, 2, ["tabby"]);
let kitty = cat(1000u, 2, ["tabby"]/~);
assert(nyan.how_hungry == 99);
assert(kitty.how_hungry == 2);
nyan.speak([1u,2u,3u]/~);
assert(nyan.meow_count() == 55u);
kitty.speak(["meow", "mew", "purr", "chirp"]);
kitty.speak(["meow", "mew", "purr", "chirp"]/~);
assert(kitty.meow_count() == 1004u);
}

View file

@ -18,11 +18,11 @@ class cat<U> {
fn main() {
let nyan : cat<int> = cat::<int>(52u, 99, [9]/~);
let kitty = cat(1000u, 2, ["tabby"]);
let kitty = cat(1000u, 2, ["tabby"]/~);
assert(nyan.how_hungry == 99);
assert(kitty.how_hungry == 2);
nyan.speak([1,2,3]/~);
assert(nyan.meow_count() == 55u);
kitty.speak(["meow", "mew", "purr", "chirp"]);
kitty.speak(["meow", "mew", "purr", "chirp"]/~);
assert(kitty.meow_count() == 1004u);
}

View file

@ -1,3 +1,3 @@
fn main(args: [str]) { log(debug, args[0]); }
fn main(args: [str]/~) { log(debug, args[0]); }

View file

@ -94,5 +94,5 @@ mod map_reduce {
}
fn main() {
map_reduce::map_reduce(["../src/test/run-pass/hashmap-memory.rs"]);
map_reduce::map_reduce(["../src/test/run-pass/hashmap-memory.rs"]/~);
}

View file

@ -30,8 +30,8 @@ fn bar<U: to_str, T: map<U>>(x: T) -> [str]/~ {
}
fn main() {
assert foo([1]) == ["hi"];
assert bar::<int, [int]>([4, 5]) == ["4", "5"];
assert bar::<str, [str]>(["x", "y"]) == ["x", "y"];
assert bar::<(), [()]>([()]) == ["()"];
assert foo([1]) == ["hi"]/~;
assert bar::<int, [int]>([4, 5]) == ["4", "5"]/~;
assert bar::<str, [str]>(["x", "y"]/~) == ["x", "y"]/~;
assert bar::<(), [()]>([()]) == ["()"]/~;
}

View file

@ -10,7 +10,7 @@ import std::map::str_hash;
import dvec;
fn main() {
let v = [mut @"hi"];
let v = [mut @"hi"]/~;
let m: req::header_map = str_hash();
m.insert("METHOD", @dvec::from_vec(v));
request::<int>(m);

View file

@ -1,4 +1,4 @@
fn main() {
assert "~[1, 2, 3]" == sys::log_str([1, 2, 3]/~);
assert #fmt["%?/%6?", [1, 2, 3], "hi"] == "~[1, 2, 3]/ ~\"hi\"";
assert #fmt["%?/%6?", [1, 2, 3]/~, "hi"] == "~[1, 2, 3]/ ~\"hi\"";
}

View file

@ -22,6 +22,6 @@ fn transform(x: option<int>) -> option<str> {
fn main() {
assert transform(some(10)) == some("11");
assert transform(none) == none;
assert ["hi"].bind {|x| [x, x + "!"]}.bind {|x| [x, x + "?"]} ==
["hi", "hi?", "hi!", "hi!?"];
assert ["hi"]/~.bind {|x| [x, x + "!"]/~}.bind {|x| [x, x + "?"]/~} ==
["hi", "hi?", "hi!", "hi!?"]/~;
}

View file

@ -2,11 +2,11 @@
impl methods<T: copy> for [T]/~ {
fn -(x: [T]/&) -> [T]/~ {
[x[0], x[0], x[0]]
[x[0], x[0], x[0]]/~
}
fn foo(x: [T]/&) -> [T]/~ {
[x[0], x[0], x[0]]
[x[0], x[0], x[0]]/~
}
}

View file

@ -47,7 +47,7 @@ fn main() {
assert find_pos(1, [0, 1, 2, 3]/~) == some(1u);
assert find_pos(1, [0, 4, 2, 3]/~) == none;
assert find_pos("hi", ["foo", "bar", "baz", "hi"]) == some(3u);
assert find_pos("hi", ["foo", "bar", "baz", "hi"]/~) == some(3u);
bail_deep([[false, false]/~, [true, true]/~, [false, true]/~]/~);
bail_deep([[true]/~]/~);

View file

@ -23,7 +23,7 @@ type ty = spanned<ty_>;
fn main() {
let sp: span = {lo: 57451u, hi: 57542u, expanded_from: os_none};
let t: @ty = @{ data: 3u, span: sp };
let p_: path_ = { global: true, idents: ["hi"], types: [t] };
let p_: path_ = { global: true, idents: ["hi"]/~, types: [t] };
let p: path = { data: p_, span: sp };
let x = { sp: sp, path: p };
log(error, x.path);

View file

@ -1,4 +1,4 @@
fn swap<T>(v: [mut T], i: int, j: int) { v[i] <-> v[j]; }
fn swap<T>(v: [mut T]/~, i: int, j: int) { v[i] <-> v[j]; }
fn main() {
let a: [mut int]/~ = [mut 0, 1, 2, 3, 4, 5, 6]/~;