Remove uses of log

This commit is contained in:
Brian Anderson 2013-03-08 12:39:42 -08:00
parent 2fef18abf2
commit 82f190355b
222 changed files with 874 additions and 955 deletions

View file

@ -22,6 +22,6 @@ fn main() {
for uint::range(0u, n) |i| {
let x = uint::to_str(i);
log(debug, x);
debug!(x);
}
}

View file

@ -181,7 +181,7 @@ fn bfs2(graph: graph, key: node_id) -> bfs_result {
let mut i = 0;
while vec::any(colors, is_gray) {
// Do the BFS.
log(info, fmt!("PBFS iteration %?", i));
info!("PBFS iteration %?", i);
i += 1;
colors = do colors.mapi() |i, c| {
let c : color = *c;
@ -257,7 +257,7 @@ fn pbfs(&&graph: arc::ARC<graph>, key: node_id) -> bfs_result {
let mut i = 0;
while par::any(colors, is_gray_factory) {
// Do the BFS.
log(info, fmt!("PBFS iteration %?", i));
info!("PBFS iteration %?", i);
i += 1;
let old_len = colors.len();
@ -320,7 +320,7 @@ fn validate(edges: ~[(node_id, node_id)],
// parent chains back to the root. While we do this, we also
// compute the levels for each node.
log(info, ~"Verifying tree structure...");
info!(~"Verifying tree structure...");
let mut status = true;
let level = do tree.map() |parent| {
@ -352,7 +352,7 @@ fn validate(edges: ~[(node_id, node_id)],
// 2. Each tree edge connects vertices whose BFS levels differ by
// exactly one.
log(info, ~"Verifying tree edges...");
info!(~"Verifying tree edges...");
let status = do tree.alli() |k, parent| {
if *parent != root && *parent != -1i64 {
@ -368,7 +368,7 @@ fn validate(edges: ~[(node_id, node_id)],
// 3. Every edge in the input list has vertices with levels that
// differ by at most one or that both are not in the BFS tree.
log(info, ~"Verifying graph edges...");
info!(~"Verifying graph edges...");
let status = do edges.all() |e| {
let (u, v) = *e;
@ -385,7 +385,7 @@ fn validate(edges: ~[(node_id, node_id)],
// 5. A node and its parent are joined by an edge of the original
// graph.
log(info, ~"Verifying tree and graph edges...");
info!(~"Verifying tree and graph edges...");
let status = do par::alli(tree) {
let edges = copy edges;

View file

@ -16,6 +16,6 @@ fn my_fail() -> ! { fail!(); }
fn main() {
match true { false => { my_fail(); } true => { } }
log(debug, x); //~ ERROR unresolved name: `x`.
debug!(x); //~ ERROR unresolved name: `x`.
let x: int;
}

View file

@ -11,6 +11,6 @@
// Check that bogus field access is non-fatal
fn main() {
let x = 0;
log(debug, x.foo); //~ ERROR attempted access of field
log(debug, x.bar); //~ ERROR attempted access of field
debug!(x.foo); //~ ERROR attempted access of field
debug!(x.bar); //~ ERROR attempted access of field
}

View file

@ -22,11 +22,11 @@ fn main() {
let a: clam = clam{x: @1, y: @2};
let b: clam = clam{x: @10, y: @20};
let z: int = a.x + b.y;
log(debug, z);
debug!(z);
fail_unless!((z == 21));
let forty: fish = fish{a: @40};
let two: fish = fish{a: @2};
let answer: int = forty.a + two.a;
log(debug, answer);
debug!(answer);
fail_unless!((answer == 42));
}

View file

@ -11,4 +11,4 @@
// error-pattern:expected `~str` but found `int`
const i: str = 10i;
fn main() { log(debug, i); }
fn main() { debug!(i); }

View file

@ -18,6 +18,6 @@ fn compute1() -> float {
fn main() {
let x = compute1();
log(debug, x);
debug!(x);
fail_unless!((x == -4f));
}

View file

@ -21,6 +21,6 @@ fn coerce(b: &fn()) -> extern fn() {
fn main() {
let i = 8;
let f = coerce(|| log(error, i) );
let f = coerce(|| error!(i) );
f();
}

View file

@ -12,5 +12,5 @@ fn main() {
let x: int = 3;
let y: &mut int = &mut x; //~ ERROR illegal borrow
*y = 5;
log (debug, *y);
debug!(*y);
}

View file

@ -26,5 +26,5 @@ fn main() {
let x = foo(10);
let _y = copy x;
//~^ ERROR copying a value of non-copyable type `foo`
log(error, x);
error!(x);
}

View file

@ -12,7 +12,7 @@
// error-pattern: dead
fn f(caller: str) { log(debug, caller); }
fn f(caller: str) { debug!(caller); }
fn main() { return f("main"); debug!("Paul is dead"); }

View file

@ -12,5 +12,5 @@
fn main() {
let a = if true { true };
log(debug, a);
debug!(a);
}

View file

@ -10,5 +10,5 @@
fn main() {
let z = ();
log(debug, z[0]); //~ ERROR cannot index a value of type `()`
debug!(z[0]); //~ ERROR cannot index a value of type `()`
}

View file

@ -9,5 +9,5 @@
// except according to those terms.
fn main() {
log(error, x); //~ ERROR unresolved name: `x`.
error!(x); //~ ERROR unresolved name: `x`.
}

View file

@ -10,7 +10,7 @@
fn main() {
for vec::each(fail!()) |i| {
log (debug, i * 2);
debug!(i * 2);
//~^ ERROR the type of this value must be known
};
}

View file

@ -15,5 +15,5 @@ struct cat {
fn main() {
let kitty : cat = cat { x: () };
log (error, *kitty);
error!(*kitty);
}

View file

@ -15,5 +15,5 @@ struct cat {
fn main() {
let nyan = cat { foo: () };
log (error, *nyan);
error!(*nyan);
}

View file

@ -11,6 +11,6 @@
enum test { thing = 3u } //~ ERROR mismatched types
//~^ ERROR expected signed integer constant
fn main() {
log(error, thing as int);
error!(thing as int);
fail_unless!((thing as int == 3));
}

View file

@ -19,13 +19,13 @@ fn main()
{
let _z = match g(1, 2) {
g(x, x) => { log(debug, x + x); }
g(x, x) => { debug!(x + x); }
//~^ ERROR Identifier x is bound more than once in the same pattern
};
let _z = match i(l(1, 2), m(3, 4)) {
i(l(x, _), m(_, x)) //~ ERROR Identifier x is bound more than once in the same pattern
=> { log(error, x + x); }
=> { error!(x + x); }
};
let _z = match (1, 2) {

View file

@ -13,5 +13,5 @@ fn main() {
const y: int = foo + 1; //~ ERROR: attempt to use a non-constant value in a constant
log(error, y);
error!(y);
}

View file

@ -15,5 +15,5 @@ fn main() {
Bar = foo //~ ERROR attempt to use a non-constant value in a constant
}
log(error, Bar);
error!(Bar);
}

View file

@ -16,10 +16,10 @@ fn f2(x: &fn()) { x(); }
fn main() {
let i = 0;
let ctr: @fn() -> int = || { f2(|| i = i + 1 ); i };
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, i);
error!(ctr());
error!(ctr());
error!(ctr());
error!(ctr());
error!(ctr());
error!(i);
}

View file

@ -13,10 +13,10 @@
fn main() {
let i = 0;
let ctr: @fn() -> int = || { i = i + 1; i };
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, i);
error!(ctr());
error!(ctr());
error!(ctr());
error!(ctr());
error!(ctr());
error!(i);
}

View file

@ -11,6 +11,6 @@
fn main() {
let i: int;
log(debug, false && { i = 5; true });
log(debug, i); //~ ERROR use of possibly uninitialized variable: `i`
debug!(false && { i = 5; true });
debug!(i); //~ ERROR use of possibly uninitialized variable: `i`
}

View file

@ -12,6 +12,6 @@
// Tests that a function with a ! annotation always actually fails
// error-pattern: some control paths may return
fn bad_bang(i: uint) -> ! { log(debug, 3); }
fn bad_bang(i: uint) -> ! { debug!(3); }
fn main() { bad_bang(5u); }

View file

@ -12,6 +12,6 @@ fn force(f: &fn()) { f(); }
fn main() {
let x: int;
force(|| {
log(debug, x); //~ ERROR capture of possibly uninitialized variable: `x`
debug!(x); //~ ERROR capture of possibly uninitialized variable: `x`
});
}

View file

@ -16,9 +16,9 @@ fn foo() -> int {
x = 0; //~ WARNING unreachable statement
}
log(debug, x); //~ ERROR use of possibly uninitialized variable: `x`
debug!(x); //~ ERROR use of possibly uninitialized variable: `x`
return 17;
}
fn main() { log(debug, foo()); }
fn main() { debug!(foo()); }

View file

@ -16,9 +16,9 @@ fn foo() -> int {
x = 0; //~ WARNING unreachable statement
}
log(debug, x); //~ ERROR use of possibly uninitialized variable: `x`
debug!(x); //~ ERROR use of possibly uninitialized variable: `x`
return 17;
}
fn main() { log(debug, foo()); }
fn main() { debug!(foo()); }

View file

@ -9,4 +9,4 @@
// except according to those terms.
fn force(f: &fn() -> int) -> int { f() }
fn main() { log(debug, force(|| {})); } //~ ERROR mismatched types
fn main() { debug!(force(|| {})); } //~ ERROR mismatched types

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn foo(x: int) { log(debug, x); }
fn foo(x: int) { debug!(x); }
fn main() {
let x: int; if 1 > 2 { x = 10; }

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn foo(x: int) { log(debug, x); }
fn foo(x: int) { debug!(x); }
fn main() {
let x: int;

View file

@ -13,5 +13,5 @@ fn main() {
let i: int;
i //~ ERROR use of possibly uninitialized variable: `i`
};
log(error, f());
error!(f());
}

View file

@ -12,7 +12,7 @@ fn main() {
let y: ~int = ~42;
let mut x: ~int;
loop {
log(debug, y);
debug!(y);
loop {
loop {
loop {

View file

@ -13,7 +13,7 @@ fn main() {
let y: ~int = ~42;
let mut x: ~int;
loop {
log(debug, y);
debug!(y);
// tjc: not sure why it prints the same error twice
while true { while true { while true { x = y; copy x; } } }
//~^ ERROR use of moved value: `y`

View file

@ -11,6 +11,6 @@
fn main() {
let i: int;
log(debug, false || { i = 5; true });
log(debug, i); //~ ERROR use of possibly uninitialized variable: `i`
debug!(false || { i = 5; true });
debug!(i); //~ ERROR use of possibly uninitialized variable: `i`
}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn foo(x: int) { log(debug, x); }
fn foo(x: int) { debug!(x); }
fn main() {
let x: int;

View file

@ -11,6 +11,6 @@
fn main() {
let x = ~5;
let y = x;
log(debug, *x); //~ ERROR use of moved value: `x`
debug!(*x); //~ ERROR use of moved value: `x`
copy y;
}

View file

@ -9,8 +9,8 @@
// except according to those terms.
fn send<T:Owned>(ch: _chan<T>, -data: T) {
log(debug, ch);
log(debug, data);
debug!(ch);
debug!(data);
fail!();
}
@ -20,7 +20,7 @@ struct _chan<T>(int);
// message after the send deinitializes it
fn test00_start(ch: _chan<~int>, message: ~int, _count: ~int) {
send(ch, message);
log(debug, message); //~ ERROR use of moved value: `message`
debug!(message); //~ ERROR use of moved value: `message`
}
fn main() { fail!(); }

View file

@ -24,5 +24,5 @@ fn main() {
fail_unless!((*arc::get(&arc_v))[2] == 3);
log(info, arc_v);
info!(arc_v);
}

View file

@ -22,5 +22,5 @@ fn main() {
fail_unless!((*arc::get(&arc_v))[2] == 3); //~ ERROR use of moved value: `arc_v`
log(info, arc_v);
info!(arc_v);
}

View file

@ -31,6 +31,6 @@ fn main() {
do task::spawn {
let y = x.take(); //~ ERROR value has non-owned type
log(error, y);
error!(y);
}
}

View file

@ -39,5 +39,5 @@ fn foo(i:int) -> foo {
fn main() {
let x = foo(10);
let _y = copy x; //~ ERROR copying a value of non-copyable type
log(error, x);
error!(x);
}

View file

@ -15,5 +15,5 @@ struct foo {
}
fn main() {
log(debug, foo{ x: 1 } as int);
debug!(foo{ x: 1 } as int);
}

View file

@ -10,4 +10,4 @@
// error-pattern:literal out of range
fn main() { log(debug, 300u8); }
fn main() { debug!(300u8); }

View file

@ -18,7 +18,7 @@ enum bar { t1((), Option<~[int]>), t2, }
fn foo(t: bar) {
match t {
t1(_, Some::<int>(x)) => {
log(debug, x);
debug!(x);
}
_ => { fail!(); }
}

View file

@ -31,7 +31,7 @@ fn main() {
// Can't do this copy
let x = ~~~A {y: r(i)};
let _z = copy x; //~ ERROR copying a value of non-copyable type
log(debug, x);
debug!(x);
}
log(error, *i);
error!(*i);
}

View file

@ -14,5 +14,5 @@ fn test(f: @fn(uint) -> uint) -> uint {
fn main() {
let f: ~fn(x: uint) -> uint = |x| 4u;
log(debug, test(f)); //~ ERROR expected @ closure, found ~ closure
debug!(test(f)); //~ ERROR expected @ closure, found ~ closure
}

View file

@ -19,5 +19,5 @@ impl Drop for r {
fn main() {
let i = ~r { b: true };
let _j = copy i; //~ ERROR copying a value of non-copyable type
log(debug, i);
debug!(i);
}

View file

@ -29,6 +29,6 @@ fn main() {
f(copy r1, copy r2);
//~^ ERROR copying a value of non-copyable type
//~^^ ERROR copying a value of non-copyable type
log(debug, (r2, *i1));
log(debug, (r1, *i2));
debug!((r2, *i1));
debug!((r1, *i2));
}

View file

@ -12,5 +12,5 @@
fn main() {
loop{}
// red herring to make sure compilation fails
log(error, 42 == 'c');
error!(42 == 'c');
}

View file

@ -11,5 +11,5 @@
// error-pattern:unsupported cast
fn main() {
log(debug, 1.0 as *libc::FILE); // Can't cast float to foreign.
debug!(1.0 as *libc::FILE); // Can't cast float to foreign.
}

View file

@ -13,7 +13,7 @@
fn f() {
let v = ~[1i];
log(debug, v.some_field_name); //type error
debug!(v.some_field_name); //type error
}
fn main() { }

View file

@ -25,5 +25,5 @@ fn main() {
let i = ~[r(0)];
let j = ~[r(1)];
let k = i + j;
log(debug, j);
debug!(j);
}

View file

@ -17,4 +17,4 @@ fn cmp() -> int {
}
}
fn main() { log(error, cmp()); }
fn main() { error!(cmp()); }

View file

@ -9,5 +9,5 @@
// except according to those terms.
// error-pattern:quux
fn my_err(s: ~str) -> ! { log(error, s); fail!(~"quux"); }
fn my_err(s: ~str) -> ! { error!(s); fail!(~"quux"); }
fn main() { 3u == my_err(~"bye"); }

View file

@ -9,5 +9,5 @@
// except according to those terms.
// error-pattern:quux
fn my_err(s: ~str) -> ! { log(error, s); fail!(~"quux"); }
fn my_err(s: ~str) -> ! { error!(s); fail!(~"quux"); }
fn main() { 3u == my_err(~"bye"); }

View file

@ -9,6 +9,6 @@
// except according to those terms.
// error-pattern:woe
fn f(a: int) { log(debug, a); }
fn f(a: int) { debug!(a); }
fn main() { f(fail!(~"woe")); }

View file

@ -17,7 +17,7 @@ pure fn even(x: uint) -> bool {
fn foo(x: uint) {
if even(x) {
log(debug, x);
debug!(x);
} else {
fail!(~"Number is odd");
}

View file

@ -9,5 +9,5 @@
// except according to those terms.
// error-pattern:quux
fn my_err(s: ~str) -> ! { log(error, s); fail!(~"quux"); }
fn my_err(s: ~str) -> ! { error!(s); fail!(~"quux"); }
fn main() { if my_err(~"bye") { } }

View file

@ -10,5 +10,5 @@
// error-pattern:get called on error result: ~"kitty"
fn main() {
log(error, result::get(&result::Err::<int,~str>(~"kitty")));
error!(result::get(&result::Err::<int,~str>(~"kitty")));
}

View file

@ -11,7 +11,7 @@
// error-pattern:whatever
fn main() {
log(error, ~"whatever");
error!(~"whatever");
// Setting the exit status only works when the scheduler terminates
// normally. In this case we're going to fail, so instead of of
// returning 50 the process will return the typical rt failure code.

View file

@ -30,7 +30,7 @@ fn r(x:int) -> r {
}
fn main() {
log(error, ~"whatever");
error!(~"whatever");
do task::spawn {
let i = r(5);
};

View file

@ -11,7 +11,7 @@
// error-pattern:whatever
fn main() {
log(error, ~"whatever");
error!(~"whatever");
// 101 is the code the runtime uses on task failure and the value
// compiletest expects run-fail tests to return.
os::set_exit_status(101);

View file

@ -12,5 +12,5 @@
fn main() {
let v = vec::from_fn(1024u, {|n| n});
// this should trip a bounds check
log(error, v[-1i8]);
error!(v[-1i8]);
}

View file

@ -13,6 +13,6 @@
// Test that the task fails after hiting the recursion limit
fn main() {
log(debug, ~"don't optimize me out");
debug!(~"don't optimize me out");
main();
}

View file

@ -17,8 +17,8 @@ fn failfn() {
fn main() {
let y = ~0;
let x: @~fn() = @(|| {
log(error, copy y);
error!(copy y);
});
failfn();
log(error, x);
error!(x);
}

View file

@ -17,8 +17,8 @@ fn failfn() {
fn main() {
let y = ~0;
let x: @@fn() = @|| {
log(error, copy y);
error!(copy y);
};
failfn();
log(error, x);
error!(x);
}

View file

@ -39,6 +39,6 @@ fn main() {
cast::forget(i1);
let x = @r(i1p);
failfn();
log(error, x);
error!(x);
}
}

View file

@ -17,5 +17,5 @@ fn failfn() {
fn main() {
let x = @~"hi";
failfn();
log(error, x);
error!(x);
}

View file

@ -25,5 +25,5 @@ impl i for ~int {
fn main() {
let x = @~0 as @i;
failfn();
log(error, x);
error!(x);
}

View file

@ -17,5 +17,5 @@ fn failfn() {
fn main() {
let x = @~~0;
failfn();
log(error, x);
error!(x);
}

View file

@ -17,5 +17,5 @@ fn failfn() {
fn main() {
let x = @~0;
failfn();
log(error, x);
error!(x);
}

View file

@ -17,5 +17,5 @@ fn failfn() {
fn main() {
let x = @~[0, 1, 2, 3, 4, 5];
failfn();
log(error, x);
error!(x);
}

View file

@ -12,5 +12,5 @@
pub fn main() {
let i: int =
match Some::<int>(3) { None::<int> => { fail!() } Some::<int>(_) => { 5 } };
log(debug, i);
debug!("%?", i);
}

View file

@ -19,12 +19,12 @@ fn foo(s: @int) {
match x {
make_t(y) => {
log(debug, y); // ref up then down
debug!("%?", y); // ref up then down
}
_ => { debug!("?"); fail!(); }
}
log(debug, ::core::sys::refcount(s));
debug!(::core::sys::refcount(s));
fail_unless!((::core::sys::refcount(s) == count + 1u));
let _ = ::core::sys::refcount(s); // don't get bitten by last-use.
}
@ -36,7 +36,7 @@ pub fn main() {
foo(s); // ref up then down
log(debug, ::core::sys::refcount(s));
debug!("%u", ::core::sys::refcount(s));
let count2 = ::core::sys::refcount(s);
let _ = ::core::sys::refcount(s); // don't get bitten by last-use.
fail_unless!(count == count2);

View file

@ -21,9 +21,9 @@ enum color {
fn process(c: color) -> int {
let mut x: int;
match c {
rgb(r, _, _) => { debug!("rgb"); log(debug, r); x = r; }
rgba(_, _, _, a) => { debug!("rgba"); log(debug, a); x = a; }
hsl(_, s, _) => { debug!("hsl"); log(debug, s); x = s; }
rgb(r, _, _) => { x = r; }
rgba(_, _, _, a) => { x = a; }
hsl(_, s, _) => { x = s; }
}
return x;
}

View file

@ -17,5 +17,5 @@ pub fn main() {
Some(num) => num as u32
};
fail_unless!(f == 1234u32);
log(error, f)
error!(f)
}

View file

@ -12,6 +12,6 @@
pub fn main() {
let a: int = 10;
log(debug, a);
debug!(a);
fail_unless!((a * (a - 1) == 90));
}

View file

@ -28,6 +28,6 @@ pub fn main() {
fail_unless!((i32_b << 1 == i32_b << 1));
fail_unless!((i32_b >> 1 == i32_b >> 1));
fail_unless!((i32_b & i32_b << 1 == 0));
log(debug, i32_b | i32_b << 1);
debug!(i32_b | i32_b << 1);
fail_unless!((i32_b | i32_b << 1 == 0x30303030));
}

View file

@ -19,6 +19,6 @@ struct Triple { x: int, y: int, z: int }
fn f<T:Copy,U:Copy>(x: T, y: U) -> Pair<T, U> { return Pair {a: x, b: y}; }
pub fn main() {
log(debug, f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
log(debug, f(5, 6).a);
debug!("%?", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
debug!("%?", f(5, 6).a);
}

View file

@ -26,8 +26,8 @@ fn general() {
a ^= b;
b ^= a;
a = a ^ b;
log(debug, a);
log(debug, b);
debug!(a);
debug!(b);
fail_unless!((b == 1));
fail_unless!((a == 2));
fail_unless!((!0xf0 & 0xff == 0xf));

View file

@ -14,7 +14,7 @@ pub fn main() {
// Statement form does not require parentheses:
for vec::each(v) |i| {
log(info, *i);
info!("%?", *i);
}
// Usable at all:

View file

@ -10,5 +10,5 @@
pub fn main() {
fn as_buf<T>(s: ~str, f: &fn(~str) -> T) -> T { f(s) }
as_buf(~"foo", |foo: ~str| -> () log(error, foo) );
as_buf(~"foo", |foo: ~str| -> () error!(foo) );
}

View file

@ -16,12 +16,10 @@ pub fn main() {
let v = ~[1, 2, 3, 4, 5, 6, 7];
let mut odds = 0;
iter_vec(v, |i| {
log(error, i);
if *i % 2 == 1 {
odds += 1;
}
log(error, odds);
});
log(error, odds);
error!(odds);
fail_unless!((odds == 4));
}

View file

@ -17,10 +17,9 @@ pub fn main() {
let mut sum = 0;
iter_vec(copy v, |i| {
iter_vec(copy v, |j| {
log(error, *i * *j);
sum += *i * *j;
});
});
log(error, sum);
error!(sum);
fail_unless!((sum == 225));
}

View file

@ -15,6 +15,6 @@ pub fn main() {
vec::map2(~[1, 2, 3, 4, 5],
~[true, false, false, true, true],
|i, b| if *b { -(*i) } else { *i } );
log(error, copy v);
error!(copy v);
fail_unless!((v == ~[-1, 2, 3, -4, -5]));
}

View file

@ -16,7 +16,7 @@ pub fn main() {
let t = task::spawn(|| child(&ch) );
let y = p.recv();
error!("received");
log(error, y);
error!(y);
fail_unless!((y == 10));
}

View file

@ -37,7 +37,7 @@ fn foo(x: int) -> int {
pub fn main() {
let x: int = 2 + 2;
log(debug, x);
debug!("%?", x);
debug!("hello, world");
log(debug, 10);
debug!("%?", 10);
}

View file

@ -12,4 +12,4 @@
const i: int = 10;
pub fn main() { log(debug, i); }
pub fn main() { debug!("%i", i); }

View file

@ -10,4 +10,4 @@
pub fn main() { let x = @mut 5; *x = 1000; log(debug, *x); }
pub fn main() { let x = @mut 5; *x = 1000; debug!("%?", *x); }

View file

@ -14,8 +14,8 @@ pub fn main() {
let v = &"hello";
let mut y : &str = &"there";
log(debug, x);
log(debug, y);
debug!(x);
debug!(y);
fail_unless!(x[0] == 'h' as u8);
fail_unless!(x[4] == 'o' as u8);
@ -30,7 +30,7 @@ pub fn main() {
let c = &"cccc";
let cc = &"ccccc";
log(debug, a);
debug!(a);
fail_unless!(a < b);
fail_unless!(a <= b);
@ -38,7 +38,7 @@ pub fn main() {
fail_unless!(b >= a);
fail_unless!(b > a);
log(debug, b);
debug!(b);
fail_unless!(a < c);
fail_unless!(a <= c);
@ -46,7 +46,7 @@ pub fn main() {
fail_unless!(c >= a);
fail_unless!(c > a);
log(debug, c);
debug!(c);
fail_unless!(c < cc);
fail_unless!(c <= cc);
@ -54,5 +54,5 @@ pub fn main() {
fail_unless!(cc >= c);
fail_unless!(cc > c);
log(debug, cc);
debug!(cc);
}

View file

@ -20,7 +20,7 @@ pub fn main() {
let c : &[int] = &[2,2,2,2,3];
let cc : &[int] = &[2,2,2,2,2,2];
log(debug, a);
debug!(a);
fail_unless!(a < b);
fail_unless!(a <= b);
@ -28,7 +28,7 @@ pub fn main() {
fail_unless!(b >= a);
fail_unless!(b > a);
log(debug, b);
debug!(b);
fail_unless!(b < c);
fail_unless!(b <= c);
@ -42,7 +42,7 @@ pub fn main() {
fail_unless!(c >= a);
fail_unless!(c > a);
log(debug, c);
debug!(c);
fail_unless!(a < cc);
fail_unless!(a <= cc);
@ -50,5 +50,5 @@ pub fn main() {
fail_unless!(cc >= a);
fail_unless!(cc > a);
log(debug, cc);
debug!(cc);
}

View file

@ -21,8 +21,8 @@ fn test_generic<T>(expected: @T, eq: compare<T>) {
fn test_box() {
fn compare_box(b1: @bool, b2: @bool) -> bool {
log(debug, *b1);
log(debug, *b2);
debug!(*b1);
debug!(*b2);
return *b1 == *b2;
}
test_generic::<bool>(@true, compare_box);

View file

@ -20,8 +20,8 @@ fn test_generic<T:Copy>(expected: ~T, eq: compare<T>) {
fn test_box() {
fn compare_box(b1: ~bool, b2: ~bool) -> bool {
log(debug, *b1);
log(debug, *b2);
debug!(*b1);
debug!(*b2);
return *b1 == *b2;
}
test_generic::<bool>(~true, compare_box);

View file

@ -15,7 +15,7 @@
fn f(x: int) -> int {
// debug!("in f:");
log(debug, x);
debug!(x);
if x == 1 {
// debug!("bottoming out");
@ -26,7 +26,7 @@ fn f(x: int) -> int {
let y: int = x * f(x - 1);
// debug!("returned");
log(debug, y);
debug!(y);
return y;
}
}

View file

@ -17,7 +17,7 @@ enum color {
}
pub fn main() {
log(error, match red {
error!(match red {
red => { 1 }
green => { 2 }
blue => { 3 }

View file

@ -14,5 +14,5 @@ pub fn main() {
fn foo(n: float) -> float { return n + 0.12345; }
let n: float = 0.1;
let m: float = foo(n);
log(debug, m);
debug!(m);
}

View file

@ -12,7 +12,7 @@
pub fn main() {
let pi = 3.1415927;
log(debug, -pi * (pi + 2.0 / pi) - pi * 5.0);
debug!(-pi * (pi + 2.0 / pi) - pi * 5.0);
if pi == 5.0 || pi < 10.0 || pi <= 2.0 || pi != 22.0 / 7.0 || pi >= 10.0
|| pi > 1.0 {
debug!("yes");

View file

@ -21,8 +21,8 @@ pub fn main() {
let mut j: int = 0;
do pairs() |p| {
let (_0, _1) = p;
log(debug, _0);
log(debug, _1);
debug!(_0);
debug!(_1);
fail_unless!((_0 + 10 == i));
i += 1;
j = _1;

View file

@ -14,9 +14,9 @@
// -*- rust -*-
pub fn main() {
let mut sum: int = 0;
do first_ten |i| { debug!("main"); log(debug, i); sum = sum + i; }
do first_ten |i| { debug!("main"); debug!(i); sum = sum + i; }
debug!("sum");
log(debug, sum);
debug!(sum);
fail_unless!((sum == 45));
}

Some files were not shown because too many files have changed in this diff Show more