diff options
Diffstat (limited to 'src/test')
103 files changed, 606 insertions, 606 deletions
diff --git a/src/test/bench/99-bottles/99bob-iter.rs b/src/test/bench/99-bottles/99bob-iter.rs index e8cc4b4b..5aa3dc2f 100644 --- a/src/test/bench/99-bottles/99bob-iter.rs +++ b/src/test/bench/99-bottles/99bob-iter.rs @@ -1,10 +1,10 @@ -/* -*- mode:rust;indent-tabs-mode:nil -*- +/* -*- mode::rust;indent-tabs-mode::nil -*- * Implementation of 99 Bottles of Beer * http://99-bottles-of-beer.net/ */ use std; -import std.Int; -import std.Str; +import std::_int; +import std::_str; fn b1() -> str { ret "# of beer on the wall, # of beer."; @@ -32,15 +32,15 @@ case (1) { ns = "1 bottle"; } case (_) { - ns = Int.to_str(n, 10u) + " bottles"; + ns = _int::to_str(n, 10u) + " bottles"; } } - while (i < Str.byte_len(t)) { + while (i < _str::byte_len(t)) { if (t.(i) == ('#' as u8)) { b += ns; } else { - Str.push_byte(b, t.(i)); + _str::push_byte(b, t.(i)); } i += 1u; } diff --git a/src/test/bench/99-bottles/99bob-pattern.rs b/src/test/bench/99-bottles/99bob-pattern.rs index fc9ddddb..311fca46 100644 --- a/src/test/bench/99-bottles/99bob-pattern.rs +++ b/src/test/bench/99-bottles/99bob-pattern.rs @@ -1,10 +1,10 @@ -/* -*- mode:rust;indent-tabs-mode:nil -*- +/* -*- mode::rust;indent-tabs-mode::nil -*- * Implementation of 99 Bottles of Beer * http://99-bottles-of-beer.net/ */ use std; -import std.Int; -import std.Str; +import std::_int; +import std::_str; tag bottle { none; dual; single; multiple(int);} @@ -25,8 +25,8 @@ fn show(bottle b) { log "Take one down and pass it around, 1 bottle of beer on the wall."; } case (multiple(?n)) { - let str nb = Int.to_str(n, 10u); - let str mb = Int.to_str(n - 1, 10u); + let str nb = _int::to_str(n, 10u); + let str mb = _int::to_str(n - 1, 10u); log nb + " bottles of beer on the wall, " + nb + " bottles of beer,"; log "Take one down and pass it around, " + mb + " bottles of beer on the wall."; diff --git a/src/test/bench/99-bottles/99bob-simple.rs b/src/test/bench/99-bottles/99bob-simple.rs index 5c0f0824..569b076a 100644 --- a/src/test/bench/99-bottles/99bob-simple.rs +++ b/src/test/bench/99-bottles/99bob-simple.rs @@ -1,10 +1,10 @@ -/* -*- mode:rust;indent-tabs-mode:nil -*- +/* -*- mode::rust;indent-tabs-mode::nil -*- * Implementation of 99 Bottles of Beer * http://99-bottles-of-beer.net/ */ use std; -import std.Int; -import std.Str; +import std::_int; +import std::_str; fn b1() -> str { ret "# of beer on the wall, # of beer."; @@ -31,15 +31,15 @@ case (1) { ns = "1 bottle"; } case (_) { - ns = Int.to_str(n, 10u) + " bottles"; + ns = _int::to_str(n, 10u) + " bottles"; } } - while (i < Str.byte_len(t)) { + while (i < _str::byte_len(t)) { if (t.(i) == ('#' as u8)) { b += ns; } else { - Str.push_byte(b, t.(i)); + _str::push_byte(b, t.(i)); } i += 1u; } diff --git a/src/test/bench/99-bottles/99bob-tail.rs b/src/test/bench/99-bottles/99bob-tail.rs index 985d9b4b..202b653b 100644 --- a/src/test/bench/99-bottles/99bob-tail.rs +++ b/src/test/bench/99-bottles/99bob-tail.rs @@ -1,15 +1,15 @@ -/* -*- mode:rust;indent-tabs-mode:nil -*- +/* -*- mode::rust;indent-tabs-mode::nil -*- * Implementation of 99 Bottles of Beer * http://99-bottles-of-beer.net/ */ use std; -import std.Int; -import std.Str; +import std::_int; +import std::_str; fn main() { fn multiple(int n) { - let str nb = Int.to_str(n, 10u); - let str mb = Int.to_str(n - 1, 10u); + let str nb = _int::to_str(n, 10u); + let str mb = _int::to_str(n - 1, 10u); log nb + " bottles of beer on the wall, " + nb + " bottles of beer,"; log "Take one down and pass it around, " + mb + " bottles of beer on the wall."; diff --git a/src/test/bench/shootout/binarytrees.rs b/src/test/bench/shootout/binarytrees.rs index aa81aaac..735ac2d5 100644 --- a/src/test/bench/shootout/binarytrees.rs +++ b/src/test/bench/shootout/binarytrees.rs @@ -1,6 +1,6 @@ use std; -import std.Int; +import std::_int; tag tree { nil; @@ -49,7 +49,7 @@ fn main() { auto depth = min_depth; while (depth <= max_depth) { - auto iterations = Int.pow(2, (max_depth - depth + min_depth) as uint); + auto iterations = _int::pow(2, (max_depth - depth + min_depth) as uint); auto chk = 0; auto i = 1; diff --git a/src/test/bench/shootout/fannkuchredux.rs b/src/test/bench/shootout/fannkuchredux.rs index 5af56a47..0d24d338 100644 --- a/src/test/bench/shootout/fannkuchredux.rs +++ b/src/test/bench/shootout/fannkuchredux.rs @@ -2,8 +2,8 @@ use std; -import std.Int; -import std.Vec; +import std::_int; +import std::_vec; fn fannkuch(int n) -> int { @@ -12,9 +12,9 @@ fn fannkuch(int n) -> int { } auto perm1init_ = perm1init; // Rustboot workaround - auto perm = Vec.init_elt(0, n as uint); - auto perm1 = Vec.init_fn(perm1init_, n as uint); - auto count = Vec.init_elt(0, n as uint); + auto perm = _vec::init_elt(0, n as uint); + auto perm1 = _vec::init_fn(perm1init_, n as uint); + auto count = _vec::init_elt(0, n as uint); auto f = 0; auto i = 0; diff --git a/src/test/bench/shootout/fasta.rs b/src/test/bench/shootout/fasta.rs index 3543c298..ec962e38 100644 --- a/src/test/bench/shootout/fasta.rs +++ b/src/test/bench/shootout/fasta.rs @@ -7,10 +7,10 @@ * http://shootout.alioth.debian.org/ */ use std; -import std.Vec; -import std.Str; -import std.UInt; -import std.Int; +import std::_vec; +import std::_str; +import std::_uint; +import std::_int; fn LINE_LENGTH() -> uint { ret 60u; @@ -54,21 +54,21 @@ fn select_random(u32 r, vec[aminoacids] genelist) -> char { ret v.(hi)._0; } } - ret bisect(genelist, 0u, Vec.len[aminoacids](genelist) - 1u, r); + ret bisect(genelist, 0u, _vec::len[aminoacids](genelist) - 1u, r); } fn make_random_fasta(str id, str desc, vec[aminoacids] genelist, int n) { log(">" + id + " " + desc); - auto rng = myrandom(std.Rand.mk_rng().next()); + auto rng = myrandom(std::rand::mk_rng().next()); let str op = ""; - for each (uint i in UInt.range(0u, n as uint)) { - Str.push_byte(op, select_random(rng.next(100u32), genelist) as u8); - if (Str.byte_len(op) >= LINE_LENGTH()) { + for each (uint i in _uint::range(0u, n as uint)) { + _str::push_byte(op, select_random(rng.next(100u32), genelist) as u8); + if (_str::byte_len(op) >= LINE_LENGTH()) { log(op); op = ""; } } - if (Str.byte_len(op) > 0u) { + if (_str::byte_len(op) > 0u) { log(op); } } @@ -76,16 +76,16 @@ fn make_random_fasta(str id, str desc, vec[aminoacids] genelist, int n) { fn make_repeat_fasta(str id, str desc, str s, int n) { log(">" + id + " " + desc); let str op = ""; - let uint sl = Str.byte_len(s); - for each (uint i in UInt.range(0u, n as uint)) { + let uint sl = _str::byte_len(s); + for each (uint i in _uint::range(0u, n as uint)) { - Str.push_byte(op, s.(i % sl)); - if (Str.byte_len(op) >= LINE_LENGTH()) { + _str::push_byte(op, s.(i % sl)); + if (_str::byte_len(op) >= LINE_LENGTH()) { log(op); op = ""; } } - if (Str.byte_len(op) > 0u) { + if (_str::byte_len(op) > 0u) { log(op); } } diff --git a/src/test/bench/shootout/nbody.rs b/src/test/bench/shootout/nbody.rs index f2041c0e..b665e760 100644 --- a/src/test/bench/shootout/nbody.rs +++ b/src/test/bench/shootout/nbody.rs @@ -19,33 +19,33 @@ fn main() { // 50000000 ); - let vec[Body.props] bodies = NBodySystem.MakeNBodySystem(); + let vec[Body::props] bodies = NBodySystem::MakeNBodySystem(); for (int n in inputs) { - log NBodySystem.energy(bodies); + log NBodySystem::energy(bodies); let int i = 0; while (i < n) { - NBodySystem.advance(bodies, 0.01); + NBodySystem::advance(bodies, 0.01); i += 1; } - log NBodySystem.energy(bodies); + log NBodySystem::energy(bodies); } } -// Body.props is a record of floats, so -// vec[Body.props] is a vector of records of floats +// Body::props is a record of floats, so +// vec[Body::props] is a vector of records of floats mod NBodySystem { - fn MakeNBodySystem() -> vec[Body.props] { - let vec[Body.props] bodies = vec( - // these each return a Body.props - Body.sun(), - Body.jupiter(), - Body.saturn(), - Body.uranus(), - Body.neptune()); + fn MakeNBodySystem() -> vec[Body::props] { + let vec[Body::props] bodies = vec( + // these each return a Body::props + Body::sun(), + Body::jupiter(), + Body::saturn(), + Body::uranus(), + Body::neptune()); let float px = 0.0; let float py = 0.0; @@ -61,12 +61,12 @@ mod NBodySystem { } // side-effecting - Body.offsetMomentum(bodies.(0), px, py, pz); + Body::offsetMomentum(bodies.(0), px, py, pz); ret bodies; } - fn advance(vec[Body.props] bodies, float dt) -> () { + fn advance(vec[Body::props] bodies, float dt) -> () { let int i = 0; while (i < 5) { @@ -86,14 +86,14 @@ mod NBodySystem { } } - fn advance_one(&Body.props bi, &Body.props bj, float dt) { + fn advance_one(&Body::props bi, &Body::props bj, float dt) { let float dx = bi.x - bj.x; let float dy = bi.y - bj.y; let float dz = bi.z - bj.z; let float dSquared = dx * dx + dy * dy + dz * dz; - let float distance = llvm.sqrt(dSquared); + let float distance = llvm::sqrt(dSquared); let float mag = dt / (dSquared * distance); bi.vx -= dx * bj.mass * mag; @@ -105,13 +105,13 @@ mod NBodySystem { bj.vz += dz * bi.mass * mag; } - fn move(&Body.props b, float dt) { + fn move(&Body::props b, float dt) { b.x += dt * b.vx; b.y += dt * b.vy; b.z += dt * b.vz; } - fn energy(vec[Body.props] bodies) -> float { + fn energy(vec[Body::props] bodies) -> float { let float dx; let float dy; let float dz; @@ -131,7 +131,7 @@ mod NBodySystem { dy = bodies.(i).y - bodies.(j).y; dz = bodies.(i).z - bodies.(j).z; - distance = llvm.sqrt(dx*dx + dy*dy + dz*dz); + distance = llvm::sqrt(dx*dx + dy*dy + dz*dz); e -= (bodies.(i).mass * bodies.(j).mass) / distance; j += 1; @@ -158,7 +158,7 @@ mod Body { mutable float vz, float mass); - fn jupiter() -> Body.props { + fn jupiter() -> Body::props { ret rec( mutable x = 4.84143144246472090e+00, mutable y = -1.16032004402742839e+00, @@ -170,7 +170,7 @@ mod Body { ); } - fn saturn() -> Body.props { + fn saturn() -> Body::props { ret rec( mutable x = 8.34336671824457987e+00, mutable y = 4.12479856412430479e+00, @@ -182,7 +182,7 @@ mod Body { ); } - fn uranus() -> Body.props { + fn uranus() -> Body::props { ret rec( mutable x = 1.28943695621391310e+01, mutable y = -1.51111514016986312e+01, @@ -194,7 +194,7 @@ mod Body { ); } - fn neptune() -> Body.props { + fn neptune() -> Body::props { ret rec( mutable x = 1.53796971148509165e+01, mutable y = -2.59193146099879641e+01, @@ -206,7 +206,7 @@ mod Body { ); } - fn sun() -> Body.props { + fn sun() -> Body::props { ret rec( mutable x = 0.0, mutable y = 0.0, @@ -218,7 +218,7 @@ mod Body { ); } - fn offsetMomentum(&Body.props props, + fn offsetMomentum(&Body::props props, float px, float py, float pz) -> () { diff --git a/src/test/compile-fail/bad-expr-path.rs b/src/test/compile-fail/bad-expr-path.rs index 01e27c5a..e8388c55 100644 --- a/src/test/compile-fail/bad-expr-path.rs +++ b/src/test/compile-fail/bad-expr-path.rs @@ -5,5 +5,5 @@ mod m1 { } fn main(vec[str] args) { - log m1.a; + log m1::a; } diff --git a/src/test/compile-fail/bad-expr-path2.rs b/src/test/compile-fail/bad-expr-path2.rs index a2f58f8e..607c9173 100644 --- a/src/test/compile-fail/bad-expr-path2.rs +++ b/src/test/compile-fail/bad-expr-path2.rs @@ -1,4 +1,4 @@ -// error-pattern: can't refer to a module as a first-class value +// error-pattern: is a module, not a mod m1 { mod a { @@ -6,5 +6,5 @@ mod m1 { } fn main(vec[str] args) { - log m1.a; + log m1::a; } diff --git a/src/test/compile-fail/break-uninit.rs b/src/test/compile-fail/break-uninit.rs index 097312b2..f7c8fac1 100644 --- a/src/test/compile-fail/break-uninit.rs +++ b/src/test/compile-fail/break-uninit.rs @@ -1,5 +1,5 @@ // xfail-boot -// error-pattern:Unsatisfied precondition +// error-pattern::Unsatisfied precondition fn foo() -> int { let int x; diff --git a/src/test/compile-fail/break-uninit2.rs b/src/test/compile-fail/break-uninit2.rs index 45d758f6..608ca03b 100644 --- a/src/test/compile-fail/break-uninit2.rs +++ b/src/test/compile-fail/break-uninit2.rs @@ -1,5 +1,5 @@ // xfail-boot -// error-pattern:Unsatisfied precondition +// error-pattern::Unsatisfied precondition fn foo() -> int { let int x; diff --git a/src/test/compile-fail/export-boot.rs b/src/test/compile-fail/export-boot.rs index 892f544f..75b9de28 100644 --- a/src/test/compile-fail/export-boot.rs +++ b/src/test/compile-fail/export-boot.rs @@ -17,5 +17,5 @@ mod foo { } fn main() { - foo.z(10); + foo::z(10); } diff --git a/src/test/compile-fail/export-fully-qualified.rs b/src/test/compile-fail/export-fully-qualified.rs index 1f62b0a8..2c64a48d 100644 --- a/src/test/compile-fail/export-fully-qualified.rs +++ b/src/test/compile-fail/export-fully-qualified.rs @@ -10,7 +10,7 @@ mod foo { export bar; fn bar() { - foo.baz(); + foo::baz(); } fn baz() { diff --git a/src/test/compile-fail/export-import.rs b/src/test/compile-fail/export-import.rs index 85125087..1ef963f8 100644 --- a/src/test/compile-fail/export-import.rs +++ b/src/test/compile-fail/export-import.rs @@ -2,7 +2,7 @@ // xfail-stage0 // error-pattern: unresolved import -import m.unexported; +import m::unexported; mod m { export exported; diff --git a/src/test/compile-fail/export-no-tag-variants.rs b/src/test/compile-fail/export-no-tag-variants.rs index 69799802..7676191c 100644 --- a/src/test/compile-fail/export-no-tag-variants.rs +++ b/src/test/compile-fail/export-no-tag-variants.rs @@ -13,5 +13,5 @@ mod foo { } fn main() { - auto x = foo.t1; + auto x = foo::t1; } diff --git a/src/test/compile-fail/export-tag-variant.rs b/src/test/compile-fail/export-tag-variant.rs index c37dac2e..5af6b07c 100644 --- a/src/test/compile-fail/export-tag-variant.rs +++ b/src/test/compile-fail/export-tag-variant.rs @@ -13,5 +13,5 @@ mod foo { } fn main() { - auto z = foo.y1; + auto z = foo::y1; } diff --git a/src/test/compile-fail/export.rs b/src/test/compile-fail/export.rs index d54e515c..8df742f4 100644 --- a/src/test/compile-fail/export.rs +++ b/src/test/compile-fail/export.rs @@ -11,5 +11,5 @@ mod foo { } fn main() { - foo.z(10); + foo::z(10); } diff --git a/src/test/compile-fail/export2.rs b/src/test/compile-fail/export2.rs index 18e84ddc..720a21d8 100644 --- a/src/test/compile-fail/export2.rs +++ b/src/test/compile-fail/export2.rs @@ -5,7 +5,7 @@ mod foo { export x; fn x() { - bar.x(); + bar::x(); } } @@ -21,5 +21,5 @@ mod bar { } fn main() { - foo.x(); + foo::x(); } diff --git a/src/test/compile-fail/import-loop-2.rs b/src/test/compile-fail/import-loop-2.rs index 474634b5..fdb9f41d 100644 --- a/src/test/compile-fail/import-loop-2.rs +++ b/src/test/compile-fail/import-loop-2.rs @@ -1,11 +1,11 @@ -// error-pattern:cyclic import +// error-pattern::cyclic import mod a { - import b.x; + import b::x; } mod b { - import a.x; + import a::x; fn main() { auto y = x; diff --git a/src/test/compile-fail/import-loop.rs b/src/test/compile-fail/import-loop.rs index 649e2d5d..f6d1f020 100644 --- a/src/test/compile-fail/import-loop.rs +++ b/src/test/compile-fail/import-loop.rs @@ -1,4 +1,4 @@ -// error-pattern:cyclic import +// error-pattern::cyclic import import x; diff --git a/src/test/compile-fail/import.rs b/src/test/compile-fail/import.rs index bf132a02..7fe01bf4 100644 --- a/src/test/compile-fail/import.rs +++ b/src/test/compile-fail/import.rs @@ -1,8 +1,8 @@ // xfail-boot // xfail-stage0 // error-pattern: unresolved import: baz -import zed.bar; -import zed.baz; +import zed::bar; +import zed::baz; mod zed { fn bar() { log "bar"; diff --git a/src/test/compile-fail/import2.rs b/src/test/compile-fail/import2.rs index 5a536193..beb704ca 100644 --- a/src/test/compile-fail/import2.rs +++ b/src/test/compile-fail/import2.rs @@ -1,6 +1,6 @@ // xfail-boot // error-pattern: unresolved name -import baz.zed.bar; +import baz::zed::bar; mod baz { } mod zed { diff --git a/src/test/compile-fail/import3.rs b/src/test/compile-fail/import3.rs index eede7626..ba7a178c 100644 --- a/src/test/compile-fail/import3.rs +++ b/src/test/compile-fail/import3.rs @@ -1,6 +1,6 @@ // xfail-boot // error-pattern: main is not a module or crate -import main.bar; +import main::bar; fn main(vec[str] args) { log "foo"; diff --git a/src/test/compile-fail/import4.rs b/src/test/compile-fail/import4.rs index bbef8d53..3df84c10 100644 --- a/src/test/compile-fail/import4.rs +++ b/src/test/compile-fail/import4.rs @@ -1,8 +1,8 @@ // xfail-boot // error-pattern: cyclic import -import zed.bar; -import bar.zed; +import zed::bar; +import bar::zed; fn main(vec[str] args) { log "loop"; diff --git a/src/test/compile-fail/multiline-comment-line-tracking.rs b/src/test/compile-fail/multiline-comment-line-tracking.rs index a345425f..a4be26a4 100644 --- a/src/test/compile-fail/multiline-comment-line-tracking.rs +++ b/src/test/compile-fail/multiline-comment-line-tracking.rs @@ -1,5 +1,5 @@ // -*- rust -*- -// error-pattern:9:2 +// error-pattern::9:2 /* 1 * 2 diff --git a/src/test/compile-fail/reserved-dec.rs b/src/test/compile-fail/reserved-dec.rs index d8c204d9..b3eae575 100644 --- a/src/test/compile-fail/reserved-dec.rs +++ b/src/test/compile-fail/reserved-dec.rs @@ -1,4 +1,4 @@ -// error-pattern:reserved keyword +// error-pattern::reserved keyword fn main() { let int dec = 0; diff --git a/src/test/compile-fail/reserved-f128.rs b/src/test/compile-fail/reserved-f128.rs index 63d00f70..cb8b5fa1 100644 --- a/src/test/compile-fail/reserved-f128.rs +++ b/src/test/compile-fail/reserved-f128.rs @@ -1,4 +1,4 @@ -// error-pattern:reserved keyword +// error-pattern::reserved keyword fn main() { let int f128 = 0; diff --git a/src/test/compile-fail/reserved-f16.rs b/src/test/compile-fail/reserved-f16.rs index bfb14cd8..d004ffb8 100644 --- a/src/test/compile-fail/reserved-f16.rs +++ b/src/test/compile-fail/reserved-f16.rs @@ -1,4 +1,4 @@ -// error-pattern:reserved keyword +// error-pattern::reserved keyword fn main() { let int f16 = 0; diff --git a/src/test/compile-fail/reserved-f80.rs b/src/test/compile-fail/reserved-f80.rs index 33e8bd5e..7d57424b 100644 --- a/src/test/compile-fail/reserved-f80.rs +++ b/src/test/compile-fail/reserved-f80.rs @@ -1,4 +1,4 @@ -// error-pattern:reserved keyword +// error-pattern::reserved keyword fn main() { let int f80 = 0; diff --git a/src/test/compile-fail/reserved-m128.rs b/src/test/compile-fail/reserved-m128.rs index c4d36bf7..6c49ab6e 100644 --- a/src/test/compile-fail/reserved-m128.rs +++ b/src/test/compile-fail/reserved-m128.rs @@ -1,4 +1,4 @@ -// error-pattern:reserved keyword +// error-pattern::reserved keyword fn main() { let int m128 = 0; diff --git a/src/test/compile-fail/reserved-m32.rs b/src/test/compile-fail/reserved-m32.rs index bdb3a427..e40f8427 100644 --- a/src/test/compile-fail/reserved-m32.rs +++ b/src/test/compile-fail/reserved-m32.rs @@ -1,4 +1,4 @@ -// error-pattern:reserved keyword +// error-pattern::reserved keyword fn main() { let int m32 = 0; diff --git a/src/test/compile-fail/reserved-m64.rs b/src/test/compile-fail/reserved-m64.rs index 034884a6..ef0406f5 100644 --- a/src/test/compile-fail/reserved-m64.rs +++ b/src/test/compile-fail/reserved-m64.rs @@ -1,4 +1,4 @@ -// error-pattern:reserved keyword +// error-pattern::reserved keyword fn main() { let int m64 = 0; diff --git a/src/test/compile-fail/self-missing-method.rs b/src/test/compile-fail/self-missing-method.rs index 01c4ea14..a65f5abf 100644 --- a/src/test/compile-fail/self-missing-method.rs +++ b/src/test/compile-fail/self-missing-method.rs @@ -1,5 +1,5 @@ // xfail-boot -// error-pattern:expecting ., found ( +// error-pattern::expecting ., found ( fn main() { obj foo() { diff --git a/src/test/compile-fail/use-uninit-2.rs b/src/test/compile-fail/use-uninit-2.rs index 79cebe28..d8e9ef80 100644 --- a/src/test/compile-fail/use-uninit-2.rs +++ b/src/test/compile-fail/use-uninit-2.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition +// error-pattern::Unsatisfied precondition fn foo(int x) { log x; diff --git a/src/test/compile-fail/use-uninit-3.rs b/src/test/compile-fail/use-uninit-3.rs index e6545451..9628d4f9 100644 --- a/src/test/compile-fail/use-uninit-3.rs +++ b/src/test/compile-fail/use-uninit-3.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition +// error-pattern::Unsatisfied precondition fn foo(int x) { log x; diff --git a/src/test/compile-fail/use-uninit-dtor.rs b/src/test/compile-fail/use-uninit-dtor.rs index fed90df6..bc8d74c2 100644 --- a/src/test/compile-fail/use-uninit-dtor.rs +++ b/src/test/compile-fail/use-uninit-dtor.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition +// error-pattern::Unsatisfied precondition fn main() { state obj foo(int x) { diff --git a/src/test/compile-fail/use-uninit.rs b/src/test/compile-fail/use-uninit.rs index 03dafdcc..4f27b5bc 100644 --- a/src/test/compile-fail/use-uninit.rs +++ b/src/test/compile-fail/use-uninit.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition +// error-pattern::Unsatisfied precondition fn foo(int x) { log x; diff --git a/src/test/run-fail/explicit-fail.rs b/src/test/run-fail/explicit-fail.rs index 37387463..3a56ebfd 100644 --- a/src/test/run-fail/explicit-fail.rs +++ b/src/test/run-fail/explicit-fail.rs @@ -1,7 +1,7 @@ // xfail-stage0 // xfail-stage1 // xfail-stage2 -// error-pattern:explicit +// error-pattern::explicit fn main() { fail; diff --git a/src/test/run-fail/fail.rs b/src/test/run-fail/fail.rs index 50269869..aedebc55 100644 --- a/src/test/run-fail/fail.rs +++ b/src/test/run-fail/fail.rs @@ -1,7 +1,7 @@ // xfail-stage0 // xfail-stage1 // xfail-stage2 -// error-pattern:1 == 2 +// error-pattern::1 == 2 fn main() { assert (1 == 2); diff --git a/src/test/run-fail/linked-failure.rs b/src/test/run-fail/linked-failure.rs index f6800088..d75391bc 100644 --- a/src/test/run-fail/linked-failure.rs +++ b/src/test/run-fail/linked-failure.rs @@ -3,7 +3,7 @@ // xfail-stage2 // -*- rust -*- -// error-pattern:1 == 2 +// error-pattern::1 == 2 fn child() { assert (1 == 2); diff --git a/src/test/run-fail/non-exhaustive-match.rs b/src/test/run-fail/non-exhaustive-match.rs index 0600f0c5..a74f9815 100644 --- a/src/test/run-fail/non-exhaustive-match.rs +++ b/src/test/run-fail/non-exhaustive-match.rs @@ -3,7 +3,7 @@ // xfail-stage2 // -*- rust -*- -// error-pattern:non-exhaustive match failure +// error-pattern::non-exhaustive match failure tag t { a; diff --git a/src/test/run-fail/pred.rs b/src/test/run-fail/pred.rs index fa2a206b..3af784a4 100644 --- a/src/test/run-fail/pred.rs +++ b/src/test/run-fail/pred.rs @@ -3,7 +3,7 @@ // xfail-stage2 // -*- rust -*- -// error-pattern:predicate check +// error-pattern::predicate check fn f(int a, int b) : lt(a,b) { } diff --git a/src/test/run-fail/str-overrun.rs b/src/test/run-fail/str-overrun.rs index 078c7493..c31f22c0 100644 --- a/src/test/run-fail/str-overrun.rs +++ b/src/test/run-fail/str-overrun.rs @@ -3,7 +3,7 @@ // xfail-stage2 // -*- rust -*- -// error-pattern:bounds check +// error-pattern::bounds check fn main() { let str s = "hello"; diff --git a/src/test/run-fail/vec-overrun.rs b/src/test/run-fail/vec-overrun.rs index 1eaedff9..c492ffea 100644 --- a/src/test/run-fail/vec-overrun.rs +++ b/src/test/run-fail/vec-overrun.rs @@ -3,7 +3,7 @@ // xfail-stage2 // -*- rust -*- -// error-pattern:bounds check +// error-pattern::bounds check fn main() { let vec[int] v = vec(10); diff --git a/src/test/run-fail/vec-underrun.rs b/src/test/run-fail/vec-underrun.rs index fab59869..837548d3 100644 --- a/src/test/run-fail/vec-underrun.rs +++ b/src/test/run-fail/vec-underrun.rs @@ -3,7 +3,7 @@ // xfail-stage2 // -*- rust -*- -// error-pattern:bounds check +// error-pattern::bounds check fn main() { let vec[int] v = vec(10, 20); diff --git a/src/test/run-pass/alt-join.rs b/src/test/run-pass/alt-join.rs index 8f45e6ff..a785f91d 100644 --- a/src/test/run-pass/alt-join.rs +++ b/src/test/run-pass/alt-join.rs @@ -1,10 +1,10 @@ use std; -import std.Option; -import std.Option.t; -import std.Option.none; -import std.Option.some; +import std::option; +import std::option::t; +import std::option::none; +import std::option::some; -fn foo[T](&Option.t[T] y) { +fn foo[T](&option::t[T] y) { let int x; let vec[int] res = vec(); diff --git a/src/test/run-pass/alt-path.rs b/src/test/run-pass/alt-path.rs index ad55713b..205500e1 100644 --- a/src/test/run-pass/alt-path.rs +++ b/src/test/run-pass/alt-path.rs @@ -4,9 +4,9 @@ mod m1 { foo2; } } -fn bar(m1.foo x) { +fn bar(m1::foo x) { alt(x) { - case (m1.foo1) { + case (m1::foo1) { } } } diff --git a/src/test/run-pass/alt-pattern-drop.rs b/src/test/run-pass/alt-pattern-drop.rs index 76e7c3aa..a59248eb 100644 --- a/src/test/run-pass/alt-pattern-drop.rs +++ b/src/test/run-pass/alt-pattern-drop.rs @@ -1,9 +1,9 @@ // -*- rust -*- use std; -import std.Str; +import std::_str; -// FIXME: import std.Dbg.const_refcount. Currently +// FIXME: import std::dbg.const_refcount. Currently // cross-crate const references don't work. const uint const_refcount = 0x7bad_face_u; @@ -20,13 +20,13 @@ fn foo(str s) { case (_) { log "?"; fail; } } - log Str.refcount(s); - assert (Str.refcount(s) == const_refcount); + log _str::refcount(s); + assert (_str::refcount(s) == const_refcount); } fn main() { let str s = "hi"; // ref up foo(s); // ref up then down - log Str.refcount(s); - assert (Str.refcount(s) == const_refcount); + log _str::refcount(s); + assert (_str::refcount(s) == const_refcount); } diff --git a/src/test/run-pass/export-abstract-tag.rs b/src/test/run-pass/export-abstract-tag.rs index b192b698..7e488631 100644 --- a/src/test/run-pass/export-abstract-tag.rs +++ b/src/test/run-pass/export-abstract-tag.rs @@ -15,5 +15,5 @@ mod foo { } fn main() { - let foo.t v = foo.f(); + let foo::t v = foo::f(); } diff --git a/src/test/run-pass/export-non-interference2.rs b/src/test/run-pass/export-non-interference2.rs index e5b324e4..533df528 100644 --- a/src/test/run-pass/export-non-interference2.rs +++ b/src/test/run-pass/export-non-interference2.rs @@ -14,5 +14,5 @@ mod foo { } fn main() { - foo.bar.y(); + foo::bar::y(); } diff --git a/src/test/run-pass/export-non-interference3.rs b/src/test/run-pass/export-non-interference3.rs index c52b13f7..7b936b63 100644 --- a/src/test/run-pass/export-non-interference3.rs +++ b/src/test/run-pass/export-non-interference3.rs @@ -2,7 +2,7 @@ mod foo { export x; fn x() { - bar.x(); + bar::x(); } } @@ -15,5 +15,5 @@ mod bar { } fn main() { - foo.x(); + foo::x(); } diff --git a/src/test/run-pass/export-tag-variant.rs b/src/test/run-pass/export-tag-variant.rs index e99bc041..309261a5 100644 --- a/src/test/run-pass/export-tag-variant.rs +++ b/src/test/run-pass/export-tag-variant.rs @@ -8,5 +8,5 @@ mod foo { } fn main() { - auto v = foo.t1; + auto v = foo::t1; } diff --git a/src/test/run-pass/export-unexported-dep.rs b/src/test/run-pass/export-unexported-dep.rs index 94ef5241..dcb88af2 100644 --- a/src/test/run-pass/export-unexported-dep.rs +++ b/src/test/run-pass/export-unexported-dep.rs @@ -20,5 +20,5 @@ mod foo { } fn main() { - foo.g(foo.f()); + foo::g(foo::f()); }
\ No newline at end of file diff --git a/src/test/run-pass/generic-fn-twice.rs b/src/test/run-pass/generic-fn-twice.rs index 0c6257f8..49dc3ed7 100644 --- a/src/test/run-pass/generic-fn-twice.rs +++ b/src/test/run-pass/generic-fn-twice.rs @@ -5,6 +5,6 @@ mod foomod { } fn main() { - foomod.foo[int](); - foomod.foo[int](); + foomod::foo[int](); + foomod::foo[int](); } diff --git a/src/test/run-pass/import.rs b/src/test/run-pass/import.rs index 76de0d18..2bccd392 100644 --- a/src/test/run-pass/import.rs +++ b/src/test/run-pass/import.rs @@ -5,8 +5,8 @@ mod foo { } mod bar { - import foo.x; - import z = foo.x; + import foo::x; + import z = foo::x; fn main() { x(10); z(10); diff --git a/src/test/run-pass/import2.rs b/src/test/run-pass/import2.rs index 31b49aea..2531b857 100644 --- a/src/test/run-pass/import2.rs +++ b/src/test/run-pass/import2.rs @@ -1,4 +1,4 @@ -import zed.bar; +import zed::bar; mod zed { fn bar() { log "bar"; diff --git a/src/test/run-pass/import3.rs b/src/test/run-pass/import3.rs index 559c6ee9..282c4d23 100644 --- a/src/test/run-pass/import3.rs +++ b/src/test/run-pass/import3.rs @@ -1,5 +1,5 @@ -import zed.bar; -import baz.zed; +import zed::bar; +import baz::zed; mod baz { mod zed { fn bar() { diff --git a/src/test/run-pass/import4.rs b/src/test/run-pass/import4.rs index 5b0cb9f3..2c4170a3 100644 --- a/src/test/run-pass/import4.rs +++ b/src/test/run-pass/import4.rs @@ -1,4 +1,4 @@ -import zed.bar; +import zed::bar; mod zed { fn bar() { log "bar"; diff --git a/src/test/run-pass/import5.rs b/src/test/run-pass/import5.rs index 5e07e708..077cc14c 100644 --- a/src/test/run-pass/import5.rs +++ b/src/test/run-pass/import5.rs @@ -1,6 +1,6 @@ -import foo.bar; +import foo::bar; mod foo { - import zed.bar; + import zed::bar; mod zed { fn bar() { log "foo"; diff --git a/src/test/run-pass/import6.rs b/src/test/run-pass/import6.rs index 5e3a9d74..c8268d99 100644 --- a/src/test/run-pass/import6.rs +++ b/src/test/run-pass/import6.rs @@ -1,5 +1,5 @@ -import bar.baz; -import foo.zed; +import bar::baz; +import foo::zed; mod foo { mod zed { fn baz() { @@ -8,7 +8,7 @@ mod foo { } } mod bar { - import zed.baz; + import zed::baz; } fn main(vec[str] args) { baz(); diff --git a/src/test/run-pass/import7.rs b/src/test/run-pass/import7.rs index 29915fb1..6b11762e 100644 --- a/src/test/run-pass/import7.rs +++ b/src/test/run-pass/import7.rs @@ -1,5 +1,5 @@ -import bar.baz; -import foo.zed; +import bar::baz; +import foo::zed; mod foo { mod zed { fn baz() { @@ -8,7 +8,7 @@ mod foo { } } mod bar { - import zed.baz; + import zed::baz; mod foo { mod zed { } diff --git a/src/test/run-pass/import8.rs b/src/test/run-pass/import8.rs index 5031e984..753d6da0 100644 --- a/src/test/run-pass/import8.rs +++ b/src/test/run-pass/import8.rs @@ -1,5 +1,5 @@ -import foo.x; -import z = foo.x; +import foo::x; +import z = foo::x; mod foo { fn x(int y) { diff --git a/src/test/run-pass/inner-module.rs b/src/test/run-pass/inner-module.rs index f5066b6e..03f32bc4 100644 --- a/src/test/run-pass/inner-module.rs +++ b/src/test/run-pass/inner-module.rs @@ -7,11 +7,11 @@ mod inner { } } fn hello() { - inner2.hello(); + inner2::hello(); } } fn main() { - inner.hello(); - inner.inner2.hello(); + inner::hello(); + inner::inner2::hello(); } diff --git a/src/test/run-pass/lib-bitv.rs b/src/test/run-pass/lib-bitv.rs index b047f47a..506d5b2a 100644 --- a/src/test/run-pass/lib-bitv.rs +++ b/src/test/run-pass/lib-bitv.rs @@ -1,132 +1,132 @@ use std; -import std.Vec; -import std.BitV; +import std::_vec; +import std::bitv; fn test_0_elements() { auto act; auto exp; - act = BitV.create(0u, false); - exp = Vec.init_elt[uint](0u, 0u); + act = bitv::create(0u, false); + exp = _vec::init_elt[uint](0u, 0u); // FIXME: why can't I write vec[uint]()? - assert (BitV.eq_vec(act, exp)); + assert (bitv::eq_vec(act, exp)); } fn test_1_element() { auto act; - act = BitV.create(1u, false); - assert (BitV.eq_vec(act, vec(0u))); + act = bitv::create(1u, false); + assert (bitv::eq_vec(act, vec(0u))); - act = BitV.create(1u, true); - assert (BitV.eq_vec(act, vec(1u))); + act = bitv::create(1u, true); + assert (bitv::eq_vec(act, vec(1u))); } fn test_10_elements() { auto act; // all 0 - act = BitV.create(10u, false); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u))); + act = bitv::create(10u, false); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u))); // all 1 - act = BitV.create(10u, true); - assert (BitV.eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u))); + act = bitv::create(10u, true); + assert (bitv::eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u))); // mixed - act = BitV.create(10u, false); - BitV.set(act, 0u, true); - BitV.set(act, 1u, true); - BitV.set(act, 2u, true); - BitV.set(act, 3u, true); - BitV.set(act, 4u, true); - assert (BitV.eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 0u, 0u, 0u, 0u, 0u))); + act = bitv::create(10u, false); + bitv::set(act, 0u, true); + bitv::set(act, 1u, true); + bitv::set(act, 2u, true); + bitv::set(act, 3u, true); + bitv::set(act, 4u, true); + assert (bitv::eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 0u, 0u, 0u, 0u, 0u))); // mixed - act = BitV.create(10u, false); - BitV.set(act, 5u, true); - BitV.set(act, 6u, true); - BitV.set(act, 7u, true); - BitV.set(act, 8u, true); - BitV.set(act, 9u, true); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 1u, 1u))); + act = bitv::create(10u, false); + bitv::set(act, 5u, true); + bitv::set(act, 6u, true); + bitv::set(act, 7u, true); + bitv::set(act, 8u, true); + bitv::set(act, 9u, true); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 1u, 1u))); // mixed - act = BitV.create(10u, false); - BitV.set(act, 0u, true); - BitV.set(act, 3u, true); - BitV.set(act, 6u, true); - BitV.set(act, 9u, true); - assert (BitV.eq_vec(act, vec(1u, 0u, 0u, 1u, 0u, 0u, 1u, 0u, 0u, 1u))); + act = bitv::create(10u, false); + bitv::set(act, 0u, true); + bitv::set(act, 3u, true); + bitv::set(act, 6u, true); + bitv::set(act, 9u, true); + assert (bitv::eq_vec(act, vec(1u, 0u, 0u, 1u, 0u, 0u, 1u, 0u, 0u, 1u))); } fn test_31_elements() { auto act; // all 0 - act = BitV.create(31u, false); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, + act = bitv::create(31u, false); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u))); // all 1 - act = BitV.create(31u, true); - assert (BitV.eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, + act = bitv::create(31u, true); + assert (bitv::eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u))); // mixed - act = BitV.create(31u, false); - BitV.set(act, 0u, true); - BitV.set(act, 1u, true); - BitV.set(act, 2u, true); - BitV.set(act, 3u, true); - BitV.set(act, 4u, true); - BitV.set(act, 5u, true); - BitV.set(act, 6u, true); - BitV.set(act, 7u, true); - assert (BitV.eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, + act = bitv::create(31u, false); + bitv::set(act, 0u, true); + bitv::set(act, 1u, true); + bitv::set(act, 2u, true); + bitv::set(act, 3u, true); + bitv::set(act, 4u, true); + bitv::set(act, 5u, true); + bitv::set(act, 6u, true); + bitv::set(act, 7u, true); + assert (bitv::eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u))); // mixed - act = BitV.create(31u, false); - BitV.set(act, 16u, true); - BitV.set(act, 17u, true); - BitV.set(act, 18u, true); - BitV.set(act, 19u, true); - BitV.set(act, 20u, true); - BitV.set(act, 21u, true); - BitV.set(act, 22u, true); - BitV.set(act, 23u, true); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, + act = bitv::create(31u, false); + bitv::set(act, 16u, true); + bitv::set(act, 17u, true); + bitv::set(act, 18u, true); + bitv::set(act, 19u, true); + bitv::set(act, 20u, true); + bitv::set(act, 21u, true); + bitv::set(act, 22u, true); + bitv::set(act, 23u, true); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u))); // mixed - act = BitV.create(31u, false); - BitV.set(act, 24u, true); - BitV.set(act, 25u, true); - BitV.set(act, 26u, true); - BitV.set(act, 27u, true); - BitV.set(act, 28u, true); - BitV.set(act, 29u, true); - BitV.set(act, 30u, true); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, + act = bitv::create(31u, false); + bitv::set(act, 24u, true); + bitv::set(act, 25u, true); + bitv::set(act, 26u, true); + bitv::set(act, 27u, true); + bitv::set(act, 28u, true); + bitv::set(act, 29u, true); + bitv::set(act, 30u, true); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 1u, 1u, 1u, 1u))); // mixed - act = BitV.create(31u, false); - BitV.set(act, 3u, true); - BitV.set(act, 17u, true); - BitV.set(act, 30u, true); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 1u, 0u, 0u, 0u, 0u, + act = bitv::create(31u, false); + bitv::set(act, 3u, true); + bitv::set(act, 17u, true); + bitv::set(act, 30u, true); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u))); @@ -136,71 +136,71 @@ fn test_32_elements() { auto act; // all 0 - act = BitV.create(32u, false); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, + act = bitv::create(32u, false); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u))); // all 1 - act = BitV.create(32u, true); - assert (BitV.eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, + act = bitv::create(32u, true); + assert (bitv::eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u))); // mixed - act = BitV.create(32u, false); - BitV.set(act, 0u, true); - BitV.set(act, 1u, true); - BitV.set(act, 2u, true); - BitV.set(act, 3u, true); - BitV.set(act, 4u, true); - BitV.set(act, 5u, true); - BitV.set(act, 6u, true); - BitV.set(act, 7u, true); - assert (BitV.eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, + act = bitv::create(32u, false); + bitv::set(act, 0u, true); + bitv::set(act, 1u, true); + bitv::set(act, 2u, true); + bitv::set(act, 3u, true); + bitv::set(act, 4u, true); + bitv::set(act, 5u, true); + bitv::set(act, 6u, true); + bitv::set(act, 7u, true); + assert (bitv::eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u))); // mixed - act = BitV.create(32u, false); - BitV.set(act, 16u, true); - BitV.set(act, 17u, true); - BitV.set(act, 18u, true); - BitV.set(act, 19u, true); - BitV.set(act, 20u, true); - BitV.set(act, 21u, true); - BitV.set(act, 22u, true); - BitV.set(act, 23u, true); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, + act = bitv::create(32u, false); + bitv::set(act, 16u, true); + bitv::set(act, 17u, true); + bitv::set(act, 18u, true); + bitv::set(act, 19u, true); + bitv::set(act, 20u, true); + bitv::set(act, 21u, true); + bitv::set(act, 22u, true); + bitv::set(act, 23u, true); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u))); // mixed - act = BitV.create(32u, false); - BitV.set(act, 24u, true); - BitV.set(act, 25u, true); - BitV.set(act, 26u, true); - BitV.set(act, 27u, true); - BitV.set(act, 28u, true); - BitV.set(act, 29u, true); - BitV.set(act, 30u, true); - BitV.set(act, 31u, true); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, + act = bitv::create(32u, false); + bitv::set(act, 24u, true); + bitv::set(act, 25u, true); + bitv::set(act, 26u, true); + bitv::set(act, 27u, true); + bitv::set(act, 28u, true); + bitv::set(act, 29u, true); + bitv::set(act, 30u, true); + bitv::set(act, 31u, true); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u))); // mixed - act = BitV.create(32u, false); - BitV.set(act, 3u, true); - BitV.set(act, 17u, true); - BitV.set(act, 30u, true); - BitV.set(act, 31u, true); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 1u, 0u, 0u, 0u, 0u, + act = bitv::create(32u, false); + bitv::set(act, 3u, true); + bitv::set(act, 17u, true); + bitv::set(act, 30u, true); + bitv::set(act, 31u, true); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u))); @@ -210,77 +210,77 @@ fn test_33_elements() { auto act; // all 0 - act = BitV.create(33u, false); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, + act = bitv::create(33u, false); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u))); // all 1 - act = BitV.create(33u, true); - assert (BitV.eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, + act = bitv::create(33u, true); + assert (bitv::eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u))); // mixed - act = BitV.create(33u, false); - BitV.set(act, 0u, true); - BitV.set(act, 1u, true); - BitV.set(act, 2u, true); - BitV.set(act, 3u, true); - BitV.set(act, 4u, true); - BitV.set(act, 5u, true); - BitV.set(act, 6u, true); - BitV.set(act, 7u, true); - assert (BitV.eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, + act = bitv::create(33u, false); + bitv::set(act, 0u, true); + bitv::set(act, 1u, true); + bitv::set(act, 2u, true); + bitv::set(act, 3u, true); + bitv::set(act, 4u, true); + bitv::set(act, 5u, true); + bitv::set(act, 6u, true); + bitv::set(act, 7u, true); + assert (bitv::eq_vec(act, vec(1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u))); // mixed - act = BitV.create(33u, false); - BitV.set(act, 16u, true); - BitV.set(act, 17u, true); - BitV.set(act, 18u, true); - BitV.set(act, 19u, true); - BitV.set(act, 20u, true); - BitV.set(act, 21u, true); - BitV.set(act, 22u, true); - BitV.set(act, 23u, true); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, + act = bitv::create(33u, false); + bitv::set(act, 16u, true); + bitv::set(act, 17u, true); + bitv::set(act, 18u, true); + bitv::set(act, 19u, true); + bitv::set(act, 20u, true); + bitv::set(act, 21u, true); + bitv::set(act, 22u, true); + bitv::set(act, 23u, true); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u))); // mixed - act = BitV.create(33u, false); - BitV.set(act, 24u, true); - BitV.set(act, 25u, true); - BitV.set(act, 26u, true); - BitV.set(act, 27u, true); - BitV.set(act, 28u, true); - BitV.set(act, 29u, true); - BitV.set(act, 30u, true); - BitV.set(act, 31u, true); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, + act = bitv::create(33u, false); + bitv::set(act, 24u, true); + bitv::set(act, 25u, true); + bitv::set(act, 26u, true); + bitv::set(act, 27u, true); + bitv::set(act, 28u, true); + bitv::set(act, 29u, true); + bitv::set(act, 30u, true); + bitv::set(act, 31u, true); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 0u))); // mixed - act = BitV.create(33u, false); - BitV.set(act, 3u, true); - BitV.set(act, 17u, true); - BitV.set(act, 30u, true); - BitV.set(act, 31u, true); - BitV.set(act, 32u, true); - assert (BitV.eq_vec(act, vec(0u, 0u, 0u, 1u, 0u, 0u, 0u, 0u, + act = bitv::create(33u, false); + bitv::set(act, 3u, true); + bitv::set(act, 17u, true); + bitv::set(act, 30u, true); + bitv::set(act, 31u, true); + bitv::set(act, 32u, true); + assert (bitv::eq_vec(act, vec(0u, 0u, 0u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u, diff --git a/src/test/run-pass/lib-box.rs b/src/test/run-pass/lib-box.rs index 62807251..e0e10f5a 100644 --- a/src/test/run-pass/lib-box.rs +++ b/src/test/run-pass/lib-box.rs @@ -1,12 +1,12 @@ use std; -import std.Box; +import std::box; fn main() { auto x = @3; auto y = @3; - assert (Box.ptr_eq[int](x, x)); - assert (Box.ptr_eq[int](y, y)); - assert (!Box.ptr_eq[int](x, y)); - assert (!Box.ptr_eq[int](y, x)); + assert (box::ptr_eq[int](x, x)); + assert (box::ptr_eq[int](y, y)); + assert (!box::ptr_eq[int](x, y)); + assert (!box::ptr_eq[int](y, x)); } diff --git a/src/test/run-pass/lib-deque.rs b/src/test/run-pass/lib-deque.rs index 9de238dc..186697fb 100644 --- a/src/test/run-pass/lib-deque.rs +++ b/src/test/run-pass/lib-deque.rs @@ -1,10 +1,10 @@ // -*- rust -*- use std; -import std.Deque; +import std::deque; fn test_simple() { - let Deque.t[int] d = Deque.create[int](); + let deque::t[int] d = deque::create[int](); assert (d.size() == 0u); d.add_front(17); d.add_front(42); @@ -57,7 +57,7 @@ fn test_simple() { } fn test_boxes(@int a, @int b, @int c, @int d) { - let Deque.t[@int] deq = Deque.create[@int](); + let deque::t[@int] deq = deque::create[@int](); assert (deq.size() == 0u); deq.add_front(a); deq.add_front(b); @@ -93,7 +93,7 @@ fn test_boxes(@int a, @int b, @int c, @int d) { type eqfn[T] = fn(&T a, &T b) -> bool; fn test_parameterized[T](eqfn[T] e, &T a, &T b, &T c, &T d) { - let Deque.t[T] deq = Deque.create[T](); + let deque::t[T] deq = deque::create[T](); assert (deq.size() == 0u); deq.add_front(a); deq.add_front(b); diff --git a/src/test/run-pass/lib-int.rs b/src/test/run-pass/lib-int.rs index a5a9a2a1..20d70ccf 100644 --- a/src/test/run-pass/lib-int.rs +++ b/src/test/run-pass/lib-int.rs @@ -1,25 +1,25 @@ use std; -import std.Int; -import std.Str.eq; +import std::_int; +import std::_str::eq; fn test_to_str() { - assert (eq(Int.to_str(0, 10u), "0")); - assert (eq(Int.to_str(1, 10u), "1")); - assert (eq(Int.to_str(-1, 10u), "-1")); - assert (eq(Int.to_str(255, 16u), "ff")); - assert (eq(Int.to_str(100, 10u), "100")); + assert (eq(_int::to_str(0, 10u), "0")); + assert (eq(_int::to_str(1, 10u), "1")); + assert (eq(_int::to_str(-1, 10u), "-1")); + assert (eq(_int::to_str(255, 16u), "ff")); + assert (eq(_int::to_str(100, 10u), "100")); } fn test_pow() { - assert (Int.pow(0, 0u) == 1); - assert (Int.pow(0, 1u) == 0); - assert (Int.pow(0, 2u) == 0); - assert (Int.pow(-1, 0u) == -1); - assert (Int.pow(1, 0u) == 1); - assert (Int.pow(-3, 2u) == 9); - assert (Int.pow(-3, 3u) == -27); - assert (Int.pow(4, 9u) == 262144); + assert (_int::pow(0, 0u) == 1); + assert (_int::pow(0, 1u) == 0); + assert (_int::pow(0, 2u) == 0); + assert (_int::pow(-1, 0u) == -1); + assert (_int::pow(1, 0u) == 1); + assert (_int::pow(-3, 2u) == 9); + assert (_int::pow(-3, 3u) == -27); + assert (_int::pow(4, 9u) == 262144); } fn main() { diff --git a/src/test/run-pass/lib-io.rs b/src/test/run-pass/lib-io.rs index e124cde3..53c13912 100644 --- a/src/test/run-pass/lib-io.rs +++ b/src/test/run-pass/lib-io.rs @@ -5,8 +5,8 @@ // -*- rust -*- use std; -import std.IO; -import std.Str; +import std::io; +import std::_str; fn test_simple(str tmpfilebase) { let str tmpfile = tmpfilebase + ".tmp"; @@ -15,14 +15,14 @@ fn test_simple(str tmpfilebase) { log frood; { - let IO.writer out = IO.file_writer(tmpfile, vec(IO.create)); + let io::writer out = io::file_writer(tmpfile, vec(io::create)); out.write_str(frood); } - let IO.reader inp = IO.file_reader(tmpfile); + let io::reader inp = io::file_reader(tmpfile); let str frood2 = inp.read_c_str(); log frood2; - assert (Str.eq(frood, frood2)); + assert (_str::eq(frood, frood2)); } fn main(vec[str] argv) { diff --git a/src/test/run-pass/lib-map.rs b/src/test/run-pass/lib-map.rs index 1f956055..402ef108 100644 --- a/src/test/run-pass/lib-map.rs +++ b/src/test/run-pass/lib-map.rs @@ -1,32 +1,32 @@ // -*- rust -*- use std; -import std.Map; -import std.Str; -import std.UInt; -import std.Util; +import std::map; +import std::_str; +import std::_uint; +import std::util; fn test_simple() { log "*** starting test_simple"; fn eq_uint(&uint x, &uint y) -> bool { ret x == y; } fn hash_uint(&uint u) -> uint { - // FIXME: can't use std.Util.id since we'd be capturing a type param, + // FIXME: can't use std::util::id since we'd be capturing a type param, // and presently we can't close items over type params. ret u; } - let Map.hashfn[uint] hasher_uint = hash_uint; - let Map.eqfn[uint] eqer_uint = eq_uint; + let map::hashfn[uint] hasher_uint = hash_uint; + let map::eqfn[uint] eqer_uint = eq_uint; - let Map.hashfn[str] hasher_str = Str.hash; - let Map.eqfn[str] eqer_str = Str.eq; + let map::hashfn[str] hasher_str = _str::hash; + let map::eqfn[str] eqer_str = _str::eq; log "uint -> uint"; - let Map.hashmap[uint, uint] hm_uu = Map.mk_hashmap[uint, uint](hasher_uint, - eqer_uint); + let map::hashmap[uint, uint] hm_uu = + map::mk_hashmap[uint, uint](hasher_uint, eqer_uint); assert (hm_uu.insert(10u, 12u)); assert (hm_uu.insert(11u, 13u)); @@ -49,7 +49,7 @@ fn test_simple() { log "str -> uint"; - let Map.hashmap[str, uint] hm_su = Map.mk_hashmap[str, uint](hasher_str, + let map::hashmap[str, uint] hm_su = map::mk_hashmap[str, uint](hasher_str, eqer_str); assert (hm_su.insert("ten", 12u)); assert (hm_su.insert(eleven, 13u)); @@ -70,42 +70,42 @@ fn test_simple() { log "uint -> str"; - let Map.hashmap[uint, str] hm_us = Map.mk_hashmap[uint, str](hasher_uint, + let map::hashmap[uint, str] hm_us = map::mk_hashmap[uint, str](hasher_uint, eqer_uint); assert (hm_us.insert(10u, "twelve")); assert (hm_us.insert(11u, "thirteen")); assert (hm_us.insert(12u, "fourteen")); - assert (Str.eq(hm_us.get(11u), "thirteen")); - assert (Str.eq(hm_us.get(12u), "fourteen")); - assert (Str.eq(hm_us.get(10u), "twelve")); + assert (_str::eq(hm_us.get(11u), "thirteen")); + assert (_str::eq(hm_us.get(12u), "fourteen")); + assert (_str::eq(hm_us.get(10u), "twelve")); assert (!hm_us.insert(12u, "fourteen")); - assert (Str.eq(hm_us.get(12u), "fourteen")); + assert (_str::eq(hm_us.get(12u), "fourteen")); assert (!hm_us.insert(12u, "twelve")); - assert (Str.eq(hm_us.get(12u), "twelve")); + assert (_str::eq(hm_us.get(12u), "twelve")); log "str -> str"; - let Map.hashmap[str, str] hm_ss = Map.mk_hashmap[str, str](hasher_str, + let map::hashmap[str, str] hm_ss = map::mk_hashmap[str, str](hasher_str, eqer_str); assert (hm_ss.insert(ten, "twelve")); assert (hm_ss.insert(eleven, "thirteen")); assert (hm_ss.insert(twelve, "fourteen")); - assert (Str.eq(hm_ss.get("eleven"), "thirteen")); - assert (Str.eq(hm_ss.get("twelve"), "fourteen")); - assert (Str.eq(hm_ss.get("ten"), "twelve")); + assert (_str::eq(hm_ss.get("eleven"), "thirteen")); + assert (_str::eq(hm_ss.get("twelve"), "fourteen")); + assert (_str::eq(hm_ss.get("ten"), "twelve")); assert (!hm_ss.insert("twelve", "fourteen")); - assert (Str.eq(hm_ss.get("twelve"), "fourteen")); + assert (_str::eq(hm_ss.get("twelve"), "fourteen")); assert (!hm_ss.insert("twelve", "twelve")); - assert (Str.eq(hm_ss.get("twelve"), "twelve")); + assert (_str::eq(hm_ss.get("twelve"), "twelve")); log "*** finished test_simple"; } @@ -120,7 +120,7 @@ fn test_growth() { fn eq_uint(&uint x, &uint y) -> bool { ret x == y; } fn hash_uint(&uint u) -> uint { - // FIXME: can't use std.Util.id since we'd be capturing a type param, + // FIXME: can't use std::util::id since we'd be capturing a type param, // and presently we can't close items over type params. ret u; } @@ -128,16 +128,16 @@ fn test_growth() { log "uint -> uint"; - let Map.hashfn[uint] hasher_uint = hash_uint; - let Map.eqfn[uint] eqer_uint = eq_uint; - let Map.hashmap[uint, uint] hm_uu = Map.mk_hashmap[uint, uint](hasher_uint, - eqer_uint); + let map::hashfn[uint] hasher_uint = hash_uint; + let map::eqfn[uint] eqer_uint = eq_uint; + let map::hashmap[uint, uint] hm_uu = + map::mk_hashmap[uint, uint](hasher_uint, eqer_uint); let uint i = 0u; while (i < num_to_insert) { assert (hm_uu.insert(i, i * i)); - log "inserting " + UInt.to_str(i, 10u) - + " -> " + UInt.to_str(i * i, 10u); + log "inserting " + _uint::to_str(i, 10u) + + " -> " + _uint::to_str(i * i, 10u); i += 1u; } @@ -145,8 +145,8 @@ fn test_growth() { i = 0u; while (i < num_to_insert) { - log "get(" + UInt.to_str(i, 10u) + ") = " - + UInt.to_str(hm_uu.get(i), 10u); + log "get(" + _uint::to_str(i, 10u) + ") = " + + _uint::to_str(hm_uu.get(i), 10u); assert (hm_uu.get(i) == i * i); i += 1u; } @@ -160,8 +160,8 @@ fn test_growth() { i = 0u; while (i < num_to_insert) { - log "get(" + UInt.to_str(i, 10u) + ") = " - + UInt.to_str(hm_uu.get(i), 10u); + log "get(" + _uint::to_str(i, 10u) + ") = " + + _uint::to_str(hm_uu.get(i), 10u); assert (hm_uu.get(i) == i * i); i += 1u; } @@ -169,16 +169,16 @@ fn test_growth() { log "str -> str"; - let Map.hashfn[str] hasher_str = Str.hash; - let Map.eqfn[str] eqer_str = Str.eq; - let Map.hashmap[str, str] hm_ss = Map.mk_hashmap[str, str](hasher_str, + let map::hashfn[str] hasher_str = _str::hash; + let map::eqfn[str] eqer_str = _str::eq; + let map::hashmap[str, str] hm_ss = map::mk_hashmap[str, str](hasher_str, eqer_str); i = 0u; while (i < num_to_insert) { - assert (hm_ss.insert(UInt.to_str(i, 2u), UInt.to_str(i * i, 2u))); - log "inserting \"" + UInt.to_str(i, 2u) - + "\" -> \"" + UInt.to_str(i * i, 2u) + "\""; + assert (hm_ss.insert(_uint::to_str(i, 2u), _uint::to_str(i * i, 2u))); + log "inserting \"" + _uint::to_str(i, 2u) + + "\" -> \"" + _uint::to_str(i * i, 2u) + "\""; i += 1u; } @@ -187,20 +187,20 @@ fn test_growth() { i = 0u; while (i < num_to_insert) { log "get(\"" - + UInt.to_str(i, 2u) + + _uint::to_str(i, 2u) + "\") = \"" - + hm_ss.get(UInt.to_str(i, 2u)) + "\""; + + hm_ss.get(_uint::to_str(i, 2u)) + "\""; - assert (Str.eq(hm_ss.get(UInt.to_str(i, 2u)), - UInt.to_str(i * i, 2u))); + assert (_str::eq(hm_ss.get(_uint::to_str(i, 2u)), + _uint::to_str(i * i, 2u))); i += 1u; } - assert (hm_ss.insert(UInt.to_str(num_to_insert, 2u), - UInt.to_str(17u, 2u))); + assert (hm_ss.insert(_uint::to_str(num_to_insert, 2u), + _uint::to_str(17u, 2u))); - assert (Str.eq(hm_ss.get(UInt.to_str(num_to_insert, 2u)), - UInt.to_str(17u, 2u))); + assert (_str::eq(hm_ss.get(_uint::to_str(num_to_insert, 2u)), + _uint::to_str(17u, 2u))); log "-----"; @@ -208,10 +208,10 @@ fn test_growth() { i = 0u; while (i < num_to_insert) { - log "get(\"" + UInt.to_str(i, 2u) + "\") = \"" - + hm_ss.get(UInt.to_str(i, 2u)) + "\""; - assert (Str.eq(hm_ss.get(UInt.to_str(i, 2u)), - UInt.to_str(i * i, 2u))); + log "get(\"" + _uint::to_str(i, 2u) + "\") = \"" + + hm_ss.get(_uint::to_str(i, 2u)) + "\""; + assert (_str::eq(hm_ss.get(_uint::to_str(i, 2u)), + _uint::to_str(i * i, 2u))); i += 1u; } @@ -234,15 +234,15 @@ fn test_removal() { assert (hash(2u) == hash(3u)); assert (hash(0u) != hash(2u)); - let Map.hashfn[uint] hasher = hash; - let Map.eqfn[uint] eqer = eq; - let Map.hashmap[uint, uint] hm = Map.mk_hashmap[uint, uint](hasher, eqer); + let map::hashfn[uint] hasher = hash; + let map::eqfn[uint] eqer = eq; + let map::hashmap[uint, uint] hm = map::mk_hashmap[uint, uint](hasher, eqer); let uint i = 0u; while (i < num_to_insert) { assert (hm.insert(i, i * i)); - log "inserting " + UInt.to_str(i, 10u) - + " -> " + UInt.to_str(i * i, 10u); + log "inserting " + _uint::to_str(i, 10u) + + " -> " + _uint::to_str(i * i, 10u); i += 1u; } @@ -279,8 +279,8 @@ fn test_removal() { i = 1u; while (i < num_to_insert) { - log "get(" + UInt.to_str(i, 10u) + ") = " - + UInt.to_str(hm.get(i), 10u); + log "get(" + _uint::to_str(i, 10u) + ") = " + + _uint::to_str(hm.get(i), 10u); assert (hm.get(i) == i * i); i += 2u; } @@ -294,8 +294,8 @@ fn test_removal() { i = 1u; while (i < num_to_insert) { - log "get(" + UInt.to_str(i, 10u) + ") = " - + UInt.to_str(hm.get(i), 10u); + log "get(" + _uint::to_str(i, 10u) + ") = " + + _uint::to_str(hm.get(i), 10u); assert (hm.get(i) == i * i); i += 2u; } @@ -305,8 +305,8 @@ fn test_removal() { i = 0u; while (i < num_to_insert) { assert (hm.insert(i, i * i)); - log "inserting " + UInt.to_str(i, 10u) - + " -> " + UInt.to_str(i * i, 10u); + log "inserting " + _uint::to_str(i, 10u) + + " -> " + _uint::to_str(i * i, 10u); i += 2u; } @@ -316,8 +316,8 @@ fn test_removal() { i = 0u; while (i < num_to_insert) { - log "get(" + UInt.to_str(i, 10u) + ") = " - + UInt.to_str(hm.get(i), 10u); + log "get(" + _uint::to_str(i, 10u) + ") = " + + _uint::to_str(hm.get(i), 10u); assert (hm.get(i) == i * i); i += 1u; } @@ -333,8 +333,8 @@ fn test_removal() { i = 0u; while (i < num_to_insert) { - log "get(" + UInt.to_str(i, 10u) + ") = " - + UInt.to_str(hm.get(i), 10u); + log "get(" + _uint::to_str(i, 10u) + ") = " + + _uint::to_str(hm.get(i), 10u); assert (hm.get(i) == i * i); i += 1u; } diff --git a/src/test/run-pass/lib-option.rs b/src/test/run-pass/lib-option.rs index 417ab482..cf004f1d 100644 --- a/src/test/run-pass/lib-option.rs +++ b/src/test/run-pass/lib-option.rs @@ -1,5 +1,5 @@ use std; fn main() { - auto x = std.Option.some[int](10); + auto x = std::option::some[int](10); } diff --git a/src/test/run-pass/lib-qsort.rs b/src/test/run-pass/lib-qsort.rs index aed5009d..2f086667 100644 --- a/src/test/run-pass/lib-qsort.rs +++ b/src/test/run-pass/lib-qsort.rs @@ -1,13 +1,13 @@ use std; fn check_sort(vec[mutable int] v1, vec[mutable int] v2) { - auto len = std.Vec.len[int](v1); + auto len = std::_vec::len[int](v1); fn ltequal(&int a, &int b) -> bool { ret a <= b; } auto f = ltequal; - std.Sort.quick_sort[int](f, v1); + std::sort::quick_sort[int](f, v1); auto i = 0u; while (i < len) { log v2.(i); diff --git a/src/test/run-pass/lib-rand.rs b/src/test/run-pass/lib-rand.rs index e423bcba..388811bc 100644 --- a/src/test/run-pass/lib-rand.rs +++ b/src/test/run-pass/lib-rand.rs @@ -4,14 +4,14 @@ // -*- rust -*- use std; -import std.Rand; +import std::rand; fn main() { - let Rand.rng r1 = Rand.mk_rng(); + let rand::rng r1 = rand::mk_rng(); log r1.next(); log r1.next(); { - auto r2 = Rand.mk_rng(); + auto r2 = rand::mk_rng(); log r1.next(); log r2.next(); log r1.next(); diff --git a/src/test/run-pass/lib-sha1.rs b/src/test/run-pass/lib-sha1.rs index c89eca59..18ea4f38 100644 --- a/src/test/run-pass/lib-sha1.rs +++ b/src/test/run-pass/lib-sha1.rs @@ -5,9 +5,9 @@ use std; -import std.SHA1; -import std.Vec; -import std.Str; +import std::sha1; +import std::_vec; +import std::_str; fn main() { @@ -67,8 +67,8 @@ fn main() { auto tests = fips_180_1_tests + wikipedia_tests; fn check_vec_eq(vec[u8] v0, vec[u8] v1) { - assert (Vec.len[u8](v0) == Vec.len[u8](v1)); - auto len = Vec.len[u8](v0); + assert (_vec::len[u8](v0) == _vec::len[u8](v1)); + auto len = _vec::len[u8](v0); auto i = 0u; while (i < len) { auto a = v0.(i); @@ -79,7 +79,7 @@ fn main() { } // Test that it works when accepting the message all at once - auto sh = SHA1.mk_sha1(); + auto sh = sha1::mk_sha1(); for (test t in tests) { sh.input_str(t.input); auto out = sh.result(); @@ -89,11 +89,11 @@ fn main() { // Test that it works when accepting the message in pieces for (test t in tests) { - auto len = Str.byte_len(t.input); + auto len = _str::byte_len(t.input); auto left = len; while (left > 0u) { auto take = (left + 1u) / 2u; - sh.input_str(Str.substr(t.input, len - left, take)); + sh.input_str(_str::substr(t.input, len - left, take)); left = left - take; } auto out = sh.result(); diff --git a/src/test/run-pass/lib-sort.rs b/src/test/run-pass/lib-sort.rs index 145d0175..6ec266fa 100644 --- a/src/test/run-pass/lib-sort.rs +++ b/src/test/run-pass/lib-sort.rs @@ -1,12 +1,12 @@ use std; fn check_sort(vec[int] v1, vec[int] v2) { - auto len = std.Vec.len[int](v1); + auto len = std::_vec::len[int](v1); fn lteq(&int a, &int b) -> bool { ret a <= b; } auto f = lteq; - auto v3 = std.Sort.merge_sort[int](f, v1); + auto v3 = std::sort::merge_sort[int](f, v1); auto i = 0u; while (i < len) { log v3.(i); diff --git a/src/test/run-pass/lib-str-buf.rs b/src/test/run-pass/lib-str-buf.rs index cd8ba9e9..af1148a5 100644 --- a/src/test/run-pass/lib-str-buf.rs +++ b/src/test/run-pass/lib-str-buf.rs @@ -4,14 +4,14 @@ // -*- rust -*- use std; -import std.Str; +import std::_str; fn main() { auto s = "hello"; - auto sb = Str.rustrt.str_buf(s); - auto s_cstr = Str.rustrt.str_from_cstr(sb); - assert (Str.eq(s_cstr, s)); - auto s_buf = Str.rustrt.str_from_buf(sb, 5u); - assert (Str.eq(s_buf, s)); + auto sb = str.rustrt.str_buf(s); + auto s_cstr = str.rustrt.str_from_cstr(sb); + assert (str.eq(s_cstr, s)); + auto s_buf = str.rustrt.str_from_buf(sb, 5u); + assert (str.eq(s_buf, s)); } diff --git a/src/test/run-pass/lib-str.rs b/src/test/run-pass/lib-str.rs index 8985c22e..eff9eef1 100644 --- a/src/test/run-pass/lib-str.rs +++ b/src/test/run-pass/lib-str.rs @@ -2,38 +2,38 @@ // xfail-stage0 use std; -import std.Str; +import std::_str; fn test_bytes_len() { - assert (Str.byte_len("") == 0u); - assert (Str.byte_len("hello world") == 11u); - assert (Str.byte_len("\x63") == 1u); - assert (Str.byte_len("\xa2") == 2u); - assert (Str.byte_len("\u03c0") == 2u); - assert (Str.byte_len("\u2620") == 3u); - assert (Str.byte_len("\U0001d11e") == 4u); + assert (_str::byte_len("") == 0u); + assert (_str::byte_len("hello world") == 11u); + assert (_str::byte_len("\x63") == 1u); + assert (_str::byte_len("\xa2") == 2u); + assert (_str::byte_len("\u03c0") == 2u); + assert (_str::byte_len("\u2620") == 3u); + assert (_str::byte_len("\U0001d11e") == 4u); } fn test_index_and_rindex() { - assert (Str.index("hello", 'e' as u8) == 1); - assert (Str.index("hello", 'o' as u8) == 4); - assert (Str.index("hello", 'z' as u8) == -1); - assert (Str.rindex("hello", 'l' as u8) == 3); - assert (Str.rindex("hello", 'h' as u8) == 0); - assert (Str.rindex("hello", 'z' as u8) == -1); + assert (_str::index("hello", 'e' as u8) == 1); + assert (_str::index("hello", 'o' as u8) == 4); + assert (_str::index("hello", 'z' as u8) == -1); + assert (_str::rindex("hello", 'l' as u8) == 3); + assert (_str::rindex("hello", 'h' as u8) == 0); + assert (_str::rindex("hello", 'z' as u8) == -1); } fn test_split() { fn t(&str s, char c, int i, &str k) { log "splitting: " + s; log i; - auto v = Str.split(s, c as u8); + auto v = _str::split(s, c as u8); log "split to: "; for (str z in v) { log z; } log "comparing: " + v.(i) + " vs. " + k; - assert (Str.eq(v.(i), k)); + assert (_str::eq(v.(i), k)); } t("abc.hello.there", '.', 0, "abc"); t("abc.hello.there", '.', 1, "hello"); @@ -46,7 +46,7 @@ fn test_split() { fn test_find() { fn t(&str haystack, &str needle, int i) { - let int j = Str.find(haystack,needle); + let int j = _str::find(haystack,needle); log "searched for " + needle; log j; assert (i == j); @@ -60,8 +60,8 @@ fn test_find() { fn test_substr() { fn t(&str a, &str b, int start) { - assert (Str.eq(Str.substr(a, start as uint, - Str.byte_len(b)), b)); + assert (_str::eq(_str::substr(a, start as uint, + _str::byte_len(b)), b)); } t("hello", "llo", 2); @@ -71,7 +71,7 @@ fn test_substr() { fn test_concat() { fn t(&vec[str] v, &str s) { - assert (Str.eq(Str.concat(v), s)); + assert (_str::eq(_str::concat(v), s)); } t(vec("you", "know", "I'm", "no", "good"), "youknowI'mnogood"); @@ -82,7 +82,7 @@ fn test_concat() { fn test_connect() { fn t(&vec[str] v, &str sep, &str s) { - assert (Str.eq(Str.connect(v, sep), s)); + assert (_str::eq(_str::connect(v, sep), s)); } t(vec("you", "know", "I'm", "no", "good"), " ", "you know I'm no good"); @@ -97,14 +97,14 @@ fn test_to_upper() { auto unicode = "\u65e5\u672c"; auto input = "abcDEF" + unicode + "xyz:.;"; auto expected = "ABCDEF" + unicode + "XYZ:.;"; - auto actual = Str.to_upper(input); - assert (Str.eq(expected, actual)); + auto actual = _str::to_upper(input); + assert (_str::eq(expected, actual)); } fn test_slice() { - assert (Str.eq("ab", Str.slice("abc", 0u, 2u))); - assert (Str.eq("bc", Str.slice("abc", 1u, 3u))); - assert (Str.eq("", Str.slice("abc", 1u, 1u))); + assert (_str::eq("ab", _str::slice("abc", 0u, 2u))); + assert (_str::eq("bc", _str::slice("abc", 1u, 3u))); + assert (_str::eq("", _str::slice("abc", 1u, 1u))); fn a_million_letter_a() -> str { auto i = 0; @@ -126,8 +126,8 @@ fn test_slice() { ret res; } - assert (Str.eq(half_a_million_letter_a(), - Str.slice(a_million_letter_a(), + assert (_str::eq(half_a_million_letter_a(), + _str::slice(a_million_letter_a(), 0u, 500000u))); } diff --git a/src/test/run-pass/lib-task.rs b/src/test/run-pass/lib-task.rs index 8e07962c..f1cca720 100644 --- a/src/test/run-pass/lib-task.rs +++ b/src/test/run-pass/lib-task.rs @@ -1,6 +1,6 @@ use std; -import std.Task; +import std::_task; fn main() { - Task.sleep(1000000u); + _task::sleep(1000000u); }
\ No newline at end of file diff --git a/src/test/run-pass/lib-uint.rs b/src/test/run-pass/lib-uint.rs index 4f787745..3de24ba3 100644 --- a/src/test/run-pass/lib-uint.rs +++ b/src/test/run-pass/lib-uint.rs @@ -1,47 +1,47 @@ // -*- rust -*- use std; -import std.UInt; +import std::_uint; fn main() { - assert (UInt.next_power_of_two(0u) == 0u); - assert (UInt.next_power_of_two(1u) == 1u); - assert (UInt.next_power_of_two(2u) == 2u); - assert (UInt.next_power_of_two(3u) == 4u); - assert (UInt.next_power_of_two(4u) == 4u); - assert (UInt.next_power_of_two(5u) == 8u); - assert (UInt.next_power_of_two(6u) == 8u); - assert (UInt.next_power_of_two(7u) == 8u); - assert (UInt.next_power_of_two(8u) == 8u); - assert (UInt.next_power_of_two(9u) == 16u); - assert (UInt.next_power_of_two(10u) == 16u); - assert (UInt.next_power_of_two(11u) == 16u); - assert (UInt.next_power_of_two(12u) == 16u); - assert (UInt.next_power_of_two(13u) == 16u); - assert (UInt.next_power_of_two(14u) == 16u); - assert (UInt.next_power_of_two(15u) == 16u); - assert (UInt.next_power_of_two(16u) == 16u); - assert (UInt.next_power_of_two(17u) == 32u); - assert (UInt.next_power_of_two(18u) == 32u); - assert (UInt.next_power_of_two(19u) == 32u); - assert (UInt.next_power_of_two(20u) == 32u); - assert (UInt.next_power_of_two(21u) == 32u); - assert (UInt.next_power_of_two(22u) == 32u); - assert (UInt.next_power_of_two(23u) == 32u); - assert (UInt.next_power_of_two(24u) == 32u); - assert (UInt.next_power_of_two(25u) == 32u); - assert (UInt.next_power_of_two(26u) == 32u); - assert (UInt.next_power_of_two(27u) == 32u); - assert (UInt.next_power_of_two(28u) == 32u); - assert (UInt.next_power_of_two(29u) == 32u); - assert (UInt.next_power_of_two(30u) == 32u); - assert (UInt.next_power_of_two(31u) == 32u); - assert (UInt.next_power_of_two(32u) == 32u); - assert (UInt.next_power_of_two(33u) == 64u); - assert (UInt.next_power_of_two(34u) == 64u); - assert (UInt.next_power_of_two(35u) == 64u); - assert (UInt.next_power_of_two(36u) == 64u); - assert (UInt.next_power_of_two(37u) == 64u); - assert (UInt.next_power_of_two(38u) == 64u); - assert (UInt.next_power_of_two(39u) == 64u); + assert (_uint::next_power_of_two(0u) == 0u); + assert (_uint::next_power_of_two(1u) == 1u); + assert (_uint::next_power_of_two(2u) == 2u); + assert (_uint::next_power_of_two(3u) == 4u); + assert (_uint::next_power_of_two(4u) == 4u); + assert (_uint::next_power_of_two(5u) == 8u); + assert (_uint::next_power_of_two(6u) == 8u); + assert (_uint::next_power_of_two(7u) == 8u); + assert (_uint::next_power_of_two(8u) == 8u); + assert (_uint::next_power_of_two(9u) == 16u); + assert (_uint::next_power_of_two(10u) == 16u); + assert (_uint::next_power_of_two(11u) == 16u); + assert (_uint::next_power_of_two(12u) == 16u); + assert (_uint::next_power_of_two(13u) == 16u); + assert (_uint::next_power_of_two(14u) == 16u); + assert (_uint::next_power_of_two(15u) == 16u); + assert (_uint::next_power_of_two(16u) == 16u); + assert (_uint::next_power_of_two(17u) == 32u); + assert (_uint::next_power_of_two(18u) == 32u); + assert (_uint::next_power_of_two(19u) == 32u); + assert (_uint::next_power_of_two(20u) == 32u); + assert (_uint::next_power_of_two(21u) == 32u); + assert (_uint::next_power_of_two(22u) == 32u); + assert (_uint::next_power_of_two(23u) == 32u); + assert (_uint::next_power_of_two(24u) == 32u); + assert (_uint::next_power_of_two(25u) == 32u); + assert (_uint::next_power_of_two(26u) == 32u); + assert (_uint::next_power_of_two(27u) == 32u); + assert (_uint::next_power_of_two(28u) == 32u); + assert (_uint::next_power_of_two(29u) == 32u); + assert (_uint::next_power_of_two(30u) == 32u); + assert (_uint::next_power_of_two(31u) == 32u); + assert (_uint::next_power_of_two(32u) == 32u); + assert (_uint::next_power_of_two(33u) == 64u); + assert (_uint::next_power_of_two(34u) == 64u); + assert (_uint::next_power_of_two(35u) == 64u); + assert (_uint::next_power_of_two(36u) == 64u); + assert (_uint::next_power_of_two(37u) == 64u); + assert (_uint::next_power_of_two(38u) == 64u); + assert (_uint::next_power_of_two(39u) == 64u); } diff --git a/src/test/run-pass/lib-vec-str-conversions.rs b/src/test/run-pass/lib-vec-str-conversions.rs index cd8b64a8..c85374bf 100644 --- a/src/test/run-pass/lib-vec-str-conversions.rs +++ b/src/test/run-pass/lib-vec-str-conversions.rs @@ -1,8 +1,8 @@ // -*- rust -*- use std; -import std.Str; -import std.Vec; +import std::_str; +import std::_vec; fn test_simple() { let str s1 = "All mimsy were the borogoves"; @@ -14,12 +14,12 @@ fn test_simple() { * working, but we should implement is_utf8 before that happens. */ - let vec[u8] v = Str.bytes(s1); - let str s2 = Str.from_bytes(v); + let vec[u8] v = _str::bytes(s1); + let str s2 = _str::from_bytes(v); let uint i = 0u; - let uint n1 = Str.byte_len(s1); - let uint n2 = Vec.len[u8](v); + let uint n1 = _str::byte_len(s1); + let uint n2 = _vec::len[u8](v); assert (n1 == n2); @@ -33,7 +33,7 @@ fn test_simple() { } log "refcnt is"; - log Str.refcount(s1); + log _str::refcount(s1); } fn main() { diff --git a/src/test/run-pass/lib-vec.rs b/src/test/run-pass/lib-vec.rs index 0905652a..f7e6157a 100644 --- a/src/test/run-pass/lib-vec.rs +++ b/src/test/run-pass/lib-vec.rs @@ -1,8 +1,8 @@ use std; fn test_init_elt() { - let vec[uint] v = std.Vec.init_elt[uint](5u, 3u); - assert (std.Vec.len[uint](v) == 3u); + let vec[uint] v = std::_vec::init_elt[uint](5u, 3u); + assert (std::_vec::len[uint](v) == 3u); assert (v.(0) == 5u); assert (v.(1) == 5u); assert (v.(2) == 5u); @@ -13,8 +13,8 @@ fn id(uint x) -> uint { } fn test_init_fn() { let fn(uint)->uint op = id; - let vec[uint] v = std.Vec.init_fn[uint](op, 5u); - assert (std.Vec.len[uint](v) == 5u); + let vec[uint] v = std::_vec::init_fn[uint](op, 5u); + assert (std::_vec::len[uint](v) == 5u); assert (v.(0) == 0u); assert (v.(1) == 1u); assert (v.(2) == 2u); @@ -24,17 +24,17 @@ fn test_init_fn() { fn test_slice() { let vec[int] v = vec(1,2,3,4,5); - auto v2 = std.Vec.slice[int](v, 2u, 4u); - assert (std.Vec.len[int](v2) == 2u); + auto v2 = std::_vec::slice[int](v, 2u, 4u); + assert (std::_vec::len[int](v2) == 2u); assert (v2.(0) == 3); assert (v2.(1) == 4); } fn test_map() { fn square(&int x) -> int { ret x * x; } - let std.Option.operator[int, int] op = square; + let std::option::operator[int, int] op = square; let vec[int] v = vec(1, 2, 3, 4, 5); - let vec[int] s = std.Vec.map[int, int](op, v); + let vec[int] s = std::_vec::map[int, int](op, v); let int i = 0; while (i < 5) { assert (v.(i) * v.(i) == s.(i)); @@ -47,7 +47,7 @@ fn test_map2() { auto f = times; auto v0 = vec(1, 2, 3, 4, 5); auto v1 = vec(5, 4, 3, 2, 1); - auto u = std.Vec.map2[int,int,int](f, v0, v1); + auto u = std::_vec::map2[int,int,int](f, v0, v1); auto i = 0; while (i < 5) { diff --git a/src/test/run-pass/mlist-cycle.rs b/src/test/run-pass/mlist-cycle.rs index b5eff76f..7a884e41 100644 --- a/src/test/run-pass/mlist-cycle.rs +++ b/src/test/run-pass/mlist-cycle.rs @@ -16,6 +16,6 @@ fn main() { let @cell first = @tup(mutable @nil()); let @cell second = @tup(mutable @link(first)); first._0 = @link(second); - std.Sys.rustrt.gc(); + std::sys.rustrt.gc(); let @cell third = @tup(mutable @nil()); } diff --git a/src/test/run-pass/mutable-alias-vec.rs b/src/test/run-pass/mutable-alias-vec.rs index 5919abdc..c63220df 100644 --- a/src/test/run-pass/mutable-alias-vec.rs +++ b/src/test/run-pass/mutable-alias-vec.rs @@ -11,7 +11,7 @@ fn main() { grow(v); grow(v); grow(v); - auto len = std.Vec.len[int](v); + auto len = std::_vec::len[int](v); log len; assert (len == (3 as uint)); } diff --git a/src/test/run-pass/native2.rs b/src/test/run-pass/native2.rs index 4815345a..df2540ae 100644 --- a/src/test/run-pass/native2.rs +++ b/src/test/run-pass/native2.rs @@ -10,7 +10,7 @@ native mod zed { } native mod libc = "libc.dylib" { - fn write(int fd, rustrt.vbuf buf, uint count) -> int; + fn write(int fd, rustrt::vbuf buf, uint count) -> int; } native "cdecl" mod baz { diff --git a/src/test/run-pass/nested-pattern.rs b/src/test/run-pass/nested-pattern.rs index cb244cc8..c44c96e5 100644 --- a/src/test/run-pass/nested-pattern.rs +++ b/src/test/run-pass/nested-pattern.rs @@ -1,13 +1,13 @@ // a bug was causing this to complain about leaked memory on exit use std; -import std.Option; -import std.Option.some; -import std.Option.none; +import std::option; +import std::option::some; +import std::option::none; tag t { foo(int, uint); - bar(int, Option.t[int]); + bar(int, option::t[int]); } fn nested(t o) { diff --git a/src/test/run-pass/path.rs b/src/test/run-pass/path.rs index e94d32eb..6b06e727 100644 --- a/src/test/run-pass/path.rs +++ b/src/test/run-pass/path.rs @@ -4,5 +4,5 @@ mod foo { } fn main(vec[str] args) { - foo.bar(0u); + foo::bar(0u); } diff --git a/src/test/run-pass/rt-circular-buffer.rs b/src/test/run-pass/rt-circular-buffer.rs index b6c545b2..b742af7c 100644 --- a/src/test/run-pass/rt-circular-buffer.rs +++ b/src/test/run-pass/rt-circular-buffer.rs @@ -5,9 +5,9 @@ use std; -import std.Option; -import std.UInt; -import std.Vec; +import std::option; +import std::_uint; +import std::_vec; // A 12-byte unit to send over the channel type record = rec(u32 val1, u32 val2, u32 val3); @@ -33,7 +33,7 @@ fn test_grow() { let record val = rec(val1=0u32, val2=0u32, val3=0u32); - for each (uint i in UInt.range(0u, 100u)) { + for each (uint i in _uint::range(0u, 100u)) { mychan <| val; } } @@ -53,11 +53,11 @@ fn test_shrink2() { let record val = rec(val1=0u32, val2=0u32, val3=0u32); - for each (uint i in UInt.range(0u, 100u)) { + for each (uint i in _uint::range(0u, 100u)) { mychan <| val; } - for each (uint i in UInt.range(0u, 100u)) { + for each (uint i in _uint::range(0u, 100u)) { auto x <- myport; } } @@ -67,7 +67,7 @@ fn test_rotate() { let port[record] myport = port(); auto mychan = chan(myport); - for each (uint i in UInt.range(0u, 100u)) { + for each (uint i in _uint::range(0u, 100u)) { auto val = rec(val1=i as u32, val2=i as u32, val3=i as u32); @@ -86,15 +86,15 @@ fn test_rotate_grow() { let port[record] myport = port(); auto mychan = chan(myport); - for each (uint j in UInt.range(0u, 10u)) { - for each (uint i in UInt.range(0u, 10u)) { + for each (uint j in _uint::range(0u, 10u)) { + for each (uint i in _uint::range(0u, 10u)) { let record val = rec(val1=i as u32, val2=i as u32, val3=i as u32); mychan <| val; } - for each (uint i in UInt.range(0u, 10u)) { + for each (uint i in _uint::range(0u, 10u)) { auto x <- myport; assert (x.val1 == i as u32); assert (x.val2 == i as u32); diff --git a/src/test/run-pass/spawn-module-qualified.rs b/src/test/run-pass/spawn-module-qualified.rs index 9f95ec95..b4bd6017 100644 --- a/src/test/run-pass/spawn-module-qualified.rs +++ b/src/test/run-pass/spawn-module-qualified.rs @@ -2,7 +2,7 @@ // xfail-stage1 // xfail-stage2 fn main() { - auto x = spawn m.child(10); + auto x = spawn m::child(10); join x; } mod m { diff --git a/src/test/run-pass/str-append.rs b/src/test/run-pass/str-append.rs index afca72a8..ed2e3a7a 100644 --- a/src/test/run-pass/str-append.rs +++ b/src/test/run-pass/str-append.rs @@ -1,7 +1,7 @@ // -*- rust -*- use std; -import std.Str; +import std::_str; fn test1() { let str s = "hello"; @@ -20,8 +20,8 @@ fn test2() { log a; log b; - assert (Str.eq(a, "abcABCabc")); - assert (Str.eq(b, "ABCabcABC")); + assert (_str::eq(a, "abcABCabc")); + assert (_str::eq(b, "ABCabcABC")); } fn main() { diff --git a/src/test/run-pass/syntax-extension-fmt.rs b/src/test/run-pass/syntax-extension-fmt.rs index 2e49e219..f0da72a3 100644 --- a/src/test/run-pass/syntax-extension-fmt.rs +++ b/src/test/run-pass/syntax-extension-fmt.rs @@ -1,11 +1,11 @@ // xfail-boot use std; -import std.Str; +import std::_str; fn test(str actual, str expected) { log actual; log expected; - assert (Str.eq(actual, expected)); + assert (_str::eq(actual, expected)); } fn main() { diff --git a/src/test/run-pass/task-comm-1.rs b/src/test/run-pass/task-comm-1.rs index c8ebdd19..8adab6e9 100644 --- a/src/test/run-pass/task-comm-1.rs +++ b/src/test/run-pass/task-comm-1.rs @@ -6,7 +6,7 @@ fn main() -> () { } fn start() { - log "Started / Finished Task."; + log "Started / Finished task."; } fn test00() { diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs index d4a135c2..2aa38b86 100644 --- a/src/test/run-pass/task-comm-12.rs +++ b/src/test/run-pass/task-comm-12.rs @@ -3,14 +3,14 @@ // xfail-stage1 // xfail-stage2 use std; -import std.Task; +import std::_task; fn main() -> () { test00(); } fn start(int task_number) { - log "Started / Finished Task."; + log "Started / Finished task."; } fn test00() { @@ -18,10 +18,10 @@ fn test00() { let task t = spawn thread "child" start(i); // Sleep long enough for the task to finish. - Task.sleep(10000u); + _task::sleep(10000u); // Try joining tasks that have already finished. join t; - log "Joined Task."; + log "Joined task."; }
\ No newline at end of file diff --git a/src/test/run-pass/task-comm-13-thread.rs b/src/test/run-pass/task-comm-13-thread.rs index fedc516b..72f3c956 100644 --- a/src/test/run-pass/task-comm-13-thread.rs +++ b/src/test/run-pass/task-comm-13-thread.rs @@ -2,7 +2,7 @@ // xfail-stage1 // xfail-stage2 use std; -import std.Task; +import std::_task; fn start(chan[int] c, int start, int number_of_messages) { let int i = 0; @@ -17,5 +17,5 @@ fn main() -> () { let port[int] p = port(); let task a = spawn thread "start" start(chan(p), 0, 10); join a; - log "Joined Task"; + log "Joined task"; }
\ No newline at end of file diff --git a/src/test/run-pass/task-comm-13.rs b/src/test/run-pass/task-comm-13.rs index 1bf5d1f5..c6de8533 100644 --- a/src/test/run-pass/task-comm-13.rs +++ b/src/test/run-pass/task-comm-13.rs @@ -2,7 +2,7 @@ // xfail-stage1 // xfail-stage2 use std; -import std.Task; +import std::_task; fn start(chan[int] c, int start, int number_of_messages) { let int i = 0; @@ -17,5 +17,5 @@ fn main() -> () { let port[int] p = port(); let task a = spawn "start" start(chan(p), 0, 10); join a; - log "Joined Task"; + log "Joined task"; }
\ No newline at end of file diff --git a/src/test/run-pass/task-comm.rs b/src/test/run-pass/task-comm.rs index 74faa149..7199db0c 100644 --- a/src/test/run-pass/task-comm.rs +++ b/src/test/run-pass/task-comm.rs @@ -97,12 +97,12 @@ fn test03() { } fn test04_start() { - log "Started Task"; + log "Started task"; let int i = 1024 * 1024 * 64; while (i > 0) { i = i - 1; } - log "Finished Task"; + log "Finished task"; } fn test04() { diff --git a/src/test/run-pass/type-sizes.rs b/src/test/run-pass/type-sizes.rs index d39a2064..fbc608ae 100644 --- a/src/test/run-pass/type-sizes.rs +++ b/src/test/run-pass/type-sizes.rs @@ -2,7 +2,7 @@ // xfail-stage1 // xfail-stage2 -import size_of = std.Sys.rustrt.size_of; +import size_of = std::sys.rustrt.size_of; use std; diff --git a/src/test/run-pass/use-import-export.rs b/src/test/run-pass/use-import-export.rs index 3e047149..f9ac5345 100644 --- a/src/test/run-pass/use-import-export.rs +++ b/src/test/run-pass/use-import-export.rs @@ -15,7 +15,7 @@ mod bar { } fn main() { - foo.x(); - bar.y(); + foo::x(); + bar::y(); } diff --git a/src/test/run-pass/use.rs b/src/test/run-pass/use.rs index 3d1a6947..ee8ae10a 100644 --- a/src/test/run-pass/use.rs +++ b/src/test/run-pass/use.rs @@ -7,8 +7,8 @@ use zed(name = "std"); use bar(name = "std", ver = "0.0.1"); // FIXME: commented out since resolve doesn't know how to handle crates yet. -// import std.Str; -// import x = std.Str; +// import std::str; +// import x = std::str; mod baz { use std; @@ -16,8 +16,8 @@ mod baz { use zed(name = "std"); use bar(name = "std", ver = "0.0.1"); - // import std.Str; - // import x = std.Str; + // import std::str; + // import x = std::str; } fn main() { diff --git a/src/test/run-pass/user.rs b/src/test/run-pass/user.rs index 877c416b..3281f448 100644 --- a/src/test/run-pass/user.rs +++ b/src/test/run-pass/user.rs @@ -8,10 +8,10 @@ use std (name = "std", uuid = _, ver = _); fn main() { - auto s = std.Str.alloc(10 as uint); + auto s = std::str.alloc(10 as uint); s += "hello "; log s; s += "there"; log s; - auto z = std.Vec.alloc[int](10 as uint); + auto z = std::vec.alloc[int](10 as uint); } diff --git a/src/test/run-pass/utf8_chars.rs b/src/test/run-pass/utf8_chars.rs index 95cbc64e..a79294ec 100644 --- a/src/test/run-pass/utf8_chars.rs +++ b/src/test/run-pass/utf8_chars.rs @@ -2,34 +2,34 @@ // xfail-stage1 // xfail-stage2 use std; -import std.Str; -import std.Vec; -import std.IO; +import std::_str; +import std::_vec; +import std::io; fn main() { // Chars of 1, 2, 3, and 4 bytes let vec[char] chs = vec('e', 'é', '€', 0x10000 as char); - let str s = Str.from_chars(chs); + let str s = _str::from_chars(chs); - assert (Str.byte_len(s) == 10u); - assert (Str.char_len(s) == 4u); - assert (Vec.len[char](Str.to_chars(s)) == 4u); - assert (Str.eq(Str.from_chars(Str.to_chars(s)), s)); - assert (Str.char_at(s, 0u) == 'e'); - assert (Str.char_at(s, 1u) == 'é'); + assert (_str::byte_len(s) == 10u); + assert (_str::char_len(s) == 4u); + assert (_vec::len[char](_str::to_chars(s)) == 4u); + assert (_str::eq(_str::from_chars(_str::to_chars(s)), s)); + assert (_str::char_at(s, 0u) == 'e'); + assert (_str::char_at(s, 1u) == 'é'); - assert (Str.is_utf8(Str.bytes(s))); - assert (!Str.is_utf8(vec(0x80_u8))); - assert (!Str.is_utf8(vec(0xc0_u8))); - assert (!Str.is_utf8(vec(0xc0_u8, 0x10_u8))); + assert (_str::is_utf8(_str::bytes(s))); + assert (!_str::is_utf8(vec(0x80_u8))); + assert (!_str::is_utf8(vec(0xc0_u8))); + assert (!_str::is_utf8(vec(0xc0_u8, 0x10_u8))); auto stack = "a×c€"; - assert (Str.pop_char(stack) == '€'); - assert (Str.pop_char(stack) == 'c'); - Str.push_char(stack, 'u'); - assert (Str.eq(stack, "a×u")); - assert (Str.shift_char(stack) == 'a'); - assert (Str.shift_char(stack) == '×'); - Str.unshift_char(stack, 'ß'); - assert (Str.eq(stack, "ßu")); + assert (_str::pop_char(stack) == '€'); + assert (_str::pop_char(stack) == 'c'); + _str::push_char(stack, 'u'); + assert (_str::eq(stack, "a×u")); + assert (_str::shift_char(stack) == 'a'); + assert (_str::shift_char(stack) == '×'); + _str::unshift_char(stack, 'ß'); + assert (_str::eq(stack, "ßu")); } diff --git a/src/test/run-pass/vec-alloc-append.rs b/src/test/run-pass/vec-alloc-append.rs index 4327e789..d0ca6ab9 100644 --- a/src/test/run-pass/vec-alloc-append.rs +++ b/src/test/run-pass/vec-alloc-append.rs @@ -6,7 +6,7 @@ use std; fn slice[T](vec[T] e) { - let vec[T] result = std.Vec.alloc[T](1 as uint); + let vec[T] result = std::vec.alloc[T](1 as uint); log "alloced"; result += e; log "appended"; diff --git a/src/test/run-pass/vec-append.rs b/src/test/run-pass/vec-append.rs index cd87ec23..dc36799b 100644 --- a/src/test/run-pass/vec-append.rs +++ b/src/test/run-pass/vec-append.rs @@ -4,11 +4,11 @@ // -*- rust -*- use std; -import std.Str; -import std.Vec; +import std::_str; +import std::_vec; -// FIXME: import std.Dbg.const_refcount. Currently +// FIXME: import std::dbg::const_refcount. Currently // cross-crate const references don't work. const uint const_refcount = 0x7bad_face_u; @@ -53,30 +53,30 @@ fn slow_growth2_helper(str s) { // ref up: s let vec[str] v = vec(mumble); // ref up: v, mumble let acc a = acc(v); // ref up: a, v - log Vec.refcount[str](v); - assert (Vec.refcount[str](v) == 2u); + log _vec::refcount[str](v); + assert (_vec::refcount[str](v) == 2u); a.add(s); // ref up: mumble, s. ref down: v - log Vec.refcount[str](v); - log Str.refcount(s); - log Str.refcount(mumble); + log _vec::refcount[str](v); + log _str::refcount(s); + log _str::refcount(mumble); - assert (Vec.refcount[str](v) == 1u); - assert (Str.refcount(s) == const_refcount); - assert (Str.refcount(mumble) == const_refcount); + assert (_vec::refcount[str](v) == 1u); + assert (_str::refcount(s) == const_refcount); + assert (_str::refcount(mumble) == const_refcount); log v.(0); - log Vec.len[str](v); - assert (Str.eq(v.(0), mumble)); - assert (Vec.len[str](v) == 1u); + log _vec::len[str](v); + assert (_str::eq(v.(0), mumble)); + assert (_vec::len[str](v) == 1u); } // ref down: a, mumble, s, v - log Str.refcount(s); - log Str.refcount(mumble); + log _str::refcount(s); + log _str::refcount(mumble); - assert (Str.refcount(s) == const_refcount); - assert (Str.refcount(mumble) == const_refcount); + assert (_str::refcount(s) == const_refcount); + assert (_str::refcount(mumble) == const_refcount); log mumble; log ss; @@ -85,8 +85,8 @@ fn slow_growth2_helper(str s) { // ref up: s fn slow_growth2() { let str s = "hi"; // ref up: s slow_growth2_helper(s); - log Str.refcount(s); - assert (Str.refcount(s) == const_refcount); + log _str::refcount(s); + assert (_str::refcount(s) == const_refcount); } fn main() { diff --git a/src/test/run-pass/vec-ref-count.rs b/src/test/run-pass/vec-ref-count.rs index 4534a861..86ba642b 100644 --- a/src/test/run-pass/vec-ref-count.rs +++ b/src/test/run-pass/vec-ref-count.rs @@ -1,12 +1,12 @@ use std; -import std.Vec; +import std::_vec; fn main() { auto v = vec(1, 2, 3); - log_err Vec.refcount[int](v); - log_err Vec.refcount[int](v); - log_err Vec.refcount[int](v); - assert (Vec.refcount[int](v) == 1u || Vec.refcount[int](v) == 2u); - assert (Vec.refcount[int](v) == 1u || Vec.refcount[int](v) == 2u); + log_err _vec::refcount[int](v); + log_err _vec::refcount[int](v); + log_err _vec::refcount[int](v); + assert (_vec::refcount[int](v) == 1u || _vec::refcount[int](v) == 2u); + assert (_vec::refcount[int](v) == 1u || _vec::refcount[int](v) == 2u); } |