Clean-up tests after debug!/std-macros change.

The entire testsuite is converted to using info! rather than debug!
because some depend on the code within the debug! being trans'd.
This commit is contained in:
Huon Wilson 2013-07-17 03:08:08 +10:00
parent b48e37e8ee
commit e4f7561bcd
218 changed files with 640 additions and 613 deletions

View File

@ -140,7 +140,8 @@ fn should_prune_unconfigured_items() {
let source = ~"#[cfg(shut_up_and_leave_me_alone)]fn a() { }";
do from_str(source) |srv| {
do exec(srv) |ctxt| {
assert!(ctxt.ast.node.module.items.is_empty());
// one item: the __std_macros secret module
assert_eq!(ctxt.ast.node.module.items.len(), 1);
}
}
}

View File

@ -255,7 +255,8 @@ mod test {
#[test]
fn should_should_extract_mod_attributes() {
let doc = mk_doc(~"#[doc = \"test\"] mod a { }");
assert!(doc.cratemod().mods()[0].desc() == Some(~"test"));
// hidden __std_macros module at the start.
assert!(doc.cratemod().mods()[1].desc() == Some(~"test"));
}
#[test]

View File

@ -190,7 +190,8 @@ mod test {
#[test]
fn should_promote_desc() {
let doc = mk_doc(~"#[doc = \"desc\"] mod m { }");
assert_eq!(doc.cratemod().mods()[0].brief(), Some(~"desc"));
// hidden __std_macros module at the start.
assert_eq!(doc.cratemod().mods()[1].brief(), Some(~"desc"));
}
#[test]

View File

@ -172,6 +172,7 @@ mod test {
use extract;
use markdown_index_pass::run;
use path_pass;
use prune_hidden_pass;
use super::pandoc_header_id;
fn mk_doc(output_style: config::OutputStyle, source: ~str)
@ -183,8 +184,10 @@ mod test {
};
let doc = extract::from_srv(srv.clone(), ~"");
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc);
let doc = (desc_to_brief_pass::mk_pass().f)(srv.clone(), doc);
let doc = (path_pass::mk_pass().f)(srv.clone(), doc);
run(srv.clone(), doc, config)
}
}
@ -240,13 +243,13 @@ mod test {
config::DocPerMod,
~"mod a { } fn b() { }"
);
assert!(doc.cratemod().index.get().entries[0] == doc::IndexEntry {
assert_eq!(doc.cratemod().index.get().entries[0], doc::IndexEntry {
kind: ~"Module",
name: ~"a",
brief: None,
link: ~"a.html"
});
assert!(doc.cratemod().index.get().entries[1] == doc::IndexEntry {
assert_eq!(doc.cratemod().index.get().entries[1], doc::IndexEntry {
kind: ~"Function",
name: ~"b",
brief: None,
@ -260,8 +263,7 @@ mod test {
config::DocPerMod,
~"#[doc = \"test\"] mod a { }"
);
assert!(doc.cratemod().index.get().entries[0].brief
== Some(~"test"));
assert_eq!(doc.cratemod().index.get().entries[0].brief, Some(~"test"));
}
#[test]
@ -270,12 +272,13 @@ mod test {
config::DocPerCrate,
~"extern { fn b(); }"
);
assert!(doc.cratemod().nmods()[0].index.get().entries[0]
== doc::IndexEntry {
kind: ~"Function",
name: ~"b",
brief: None,
link: ~"#function-b"
});
// hidden __std_macros module at the start.
assert_eq!(doc.cratemod().nmods()[0].index.get().entries[0],
doc::IndexEntry {
kind: ~"Function",
name: ~"b",
brief: None,
link: ~"#function-b"
});
}
}

View File

@ -529,6 +529,7 @@ mod test {
use markdown_writer;
use path_pass;
use page_pass;
use prune_hidden_pass;
use sectionalize_pass;
use trim_pass;
use tystr_pass;
@ -557,6 +558,8 @@ mod test {
debug!("doc (path): %?", doc);
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
debug!("doc (attr): %?", doc);
let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc);
debug!("doc (prune_hidden): %?", doc);
let doc = (desc_to_brief_pass::mk_pass().f)(srv.clone(), doc);
debug!("doc (desc_to_brief): %?", doc);
let doc = (unindent_pass::mk_pass().f)(srv.clone(), doc);

View File

@ -277,7 +277,8 @@ mod test {
.. config::default_config(&Path("input/test.rc"))
};
let doc = mk_doc(~"", ~"mod a { mod b { } }");
let modb = copy doc.cratemod().mods()[0].mods()[0];
// hidden __std_macros module at the start.
let modb = copy doc.cratemod().mods()[1].mods()[0];
let page = doc::ItemPage(doc::ModTag(modb));
let filename = make_local_filename(&config, page);
assert_eq!(filename, Path("output/dir/a_b.html"));

View File

@ -152,8 +152,10 @@ fn fold_nmod(
mod test {
use astsrv;
use config;
use attr_pass;
use doc;
use extract;
use prune_hidden_pass;
use page_pass::run;
fn mk_doc_(
@ -162,6 +164,8 @@ mod test {
) -> doc::Doc {
do astsrv::from_str(copy source) |srv| {
let doc = extract::from_srv(srv.clone(), ~"");
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc);
run(srv.clone(), doc, output_style)
}
}
@ -182,6 +186,7 @@ mod test {
#[test]
fn should_make_a_page_for_every_mod() {
let doc = mk_doc(~"mod a { }");
// hidden __std_macros module at the start.
assert_eq!(doc.pages.mods()[0].name(), ~"a");
}

View File

@ -97,10 +97,11 @@ fn should_record_mod_paths() {
do astsrv::from_str(source) |srv| {
let doc = extract::from_srv(srv.clone(), ~"");
let doc = run(srv.clone(), doc);
assert!(doc.cratemod().mods()[0].mods()[0].mods()[0].path()
== ~[~"a", ~"b"]);
assert!(doc.cratemod().mods()[0].mods()[1].mods()[0].path()
== ~[~"a", ~"d"]);
// hidden __std_macros module at the start.
assert_eq!(doc.cratemod().mods()[1].mods()[0].mods()[0].path(),
~[~"a", ~"b"]);
assert_eq!(doc.cratemod().mods()[1].mods()[1].mods()[0].path(),
~[~"a", ~"d"]);
}
}
@ -110,6 +111,7 @@ fn should_record_fn_paths() {
do astsrv::from_str(source) |srv| {
let doc = extract::from_srv(srv.clone(), ~"");
let doc = run(srv.clone(), doc);
assert_eq!(doc.cratemod().mods()[0].fns()[0].path(), ~[~"a"]);
// hidden __std_macros module at the start.
assert_eq!(doc.cratemod().mods()[1].fns()[0].path(), ~[~"a"]);
}
}

View File

@ -166,12 +166,14 @@ mod test {
use attr_pass;
use doc;
use extract;
use prune_hidden_pass;
use sectionalize_pass::run;
fn mk_doc(source: ~str) -> doc::Doc {
do astsrv::from_str(copy source) |srv| {
let doc = extract::from_srv(srv.clone(), ~"");
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc);
run(srv.clone(), doc)
}
}

View File

@ -31,7 +31,8 @@ fn test() {
do astsrv::from_str(source) |srv| {
let doc = extract::from_srv(srv.clone(), ~"");
let doc = (mk_pass().f)(srv.clone(), doc);
assert_eq!(doc.cratemod().items[0].name(), ~"y");
assert_eq!(doc.cratemod().items[1].name(), ~"z");
// hidden __std_macros module at the start.
assert_eq!(doc.cratemod().items[1].name(), ~"y");
assert_eq!(doc.cratemod().items[2].name(), ~"z");
}
}

View File

@ -53,6 +53,7 @@ fn test() {
do astsrv::from_str(source) |srv| {
let doc = extract::from_srv(srv.clone(), ~"");
let doc = (mk_pass().f)(srv.clone(), doc);
// hidden __std_macros module at the start.
assert_eq!(doc.cratemod().items[0].name(), ~"iconst");
assert_eq!(doc.cratemod().items[1].name(), ~"itype");
assert_eq!(doc.cratemod().items[2].name(), ~"ienum");
@ -60,6 +61,7 @@ fn test() {
assert_eq!(doc.cratemod().items[4].name(), ~"itrait");
assert_eq!(doc.cratemod().items[5].name(), ~"__extensions__");
assert_eq!(doc.cratemod().items[6].name(), ~"ifn");
assert_eq!(doc.cratemod().items[7].name(), ~"imod");
// hidden __std_macros module fits here.
assert_eq!(doc.cratemod().items[8].name(), ~"imod");
}
}

View File

@ -67,10 +67,11 @@ fn test() {
do astsrv::from_str(source) |srv| {
let doc = extract::from_srv(srv.clone(), ~"");
let doc = (mk_pass(~"", name_lteq).f)(srv.clone(), doc);
assert_eq!(doc.cratemod().mods()[0].name(), ~"w");
assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"x");
assert_eq!(doc.cratemod().mods()[1].items[1].name(), ~"y");
assert_eq!(doc.cratemod().mods()[1].name(), ~"z");
// hidden __std_macros module at the start.
assert_eq!(doc.cratemod().mods()[1].name(), ~"w");
assert_eq!(doc.cratemod().mods()[2].items[0].name(), ~"x");
assert_eq!(doc.cratemod().mods()[2].items[1].name(), ~"y");
assert_eq!(doc.cratemod().mods()[2].name(), ~"z");
}
}
@ -84,10 +85,11 @@ fn should_be_stable() {
do astsrv::from_str(source) |srv| {
let doc = extract::from_srv(srv.clone(), ~"");
let doc = (mk_pass(~"", always_eq).f)(srv.clone(), doc);
assert_eq!(doc.cratemod().mods()[0].items[0].name(), ~"b");
assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"d");
// hidden __std_macros module at the start.
assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"b");
assert_eq!(doc.cratemod().mods()[2].items[0].name(), ~"d");
let doc = (mk_pass(~"", always_eq).f)(srv.clone(), doc);
assert_eq!(doc.cratemod().mods()[0].items[0].name(), ~"b");
assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"d");
assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"b");
assert_eq!(doc.cratemod().mods()[2].items[0].name(), ~"d");
}
}

View File

@ -28,12 +28,14 @@ mod test {
use attr_pass;
use doc;
use extract;
use prune_hidden_pass;
use trim_pass::mk_pass;
fn mk_doc(source: ~str) -> doc::Doc {
do astsrv::from_str(copy source) |srv| {
let doc = extract::from_srv(srv.clone(), ~"");
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc);
(mk_pass().f)(srv.clone(), doc)
}
}

View File

@ -453,8 +453,9 @@ pub fn new_span(cx: @ExtCtxt, sp: span) -> span {
pub fn std_macros() -> @str {
return
@"pub mod __std_macros {
@"mod __std_macros {
#[macro_escape];
#[doc(hidden)];
macro_rules! ignore (($($x:tt)*) => (()))

View File

@ -26,7 +26,7 @@ pub mod rustrt {
pub fn fact(n: uint) -> uint {
unsafe {
debug!("n = %?", n);
info!("n = %?", n);
rustrt::rust_dbg_call(cb, n)
}
}

View File

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

View File

@ -110,6 +110,6 @@ fn main() {
copy args
};
debug!("%?", args);
info!("%?", args);
run(args);
}

View File

@ -106,6 +106,6 @@ fn main() {
copy args
};
debug!("%?", args);
info!("%?", args);
run(args);
}

View File

@ -44,7 +44,7 @@ fn roundtrip(id: int, n_tasks: int, p: &Port<int>, ch: &Chan<int>) {
return;
}
token => {
debug!("thread: %d got token: %d", id, token);
info!("thread: %d got token: %d", id, token);
ch.send(token - 1);
if token <= n_tasks {
return;

View File

@ -33,11 +33,11 @@ fn main() {
fn run(repeat: int, depth: int) {
for (repeat as uint).times {
debug!("starting %.4f", precise_time_s());
info!("starting %.4f", precise_time_s());
do task::try {
recurse_or_fail(depth, None)
};
debug!("stopping %.4f", precise_time_s());
info!("stopping %.4f", precise_time_s());
}
}
@ -71,7 +71,7 @@ fn r(l: @nillist) -> r {
fn recurse_or_fail(depth: int, st: Option<State>) {
if depth == 0 {
debug!("unwinding %.4f", precise_time_s());
info!("unwinding %.4f", precise_time_s());
fail!();
} else {
let depth = depth - 1;

View File

@ -11,9 +11,9 @@
fn test() {
let v: int;
v = 1; //~ NOTE prior assignment occurs here
debug!("v=%d", v);
info!("v=%d", v);
v = 2; //~ ERROR re-assignment of immutable variable
debug!("v=%d", v);
info!("v=%d", v);
}
fn main() {

View File

@ -27,5 +27,5 @@ fn cat(in_x : uint, in_y : int) -> cat {
fn main() {
let nyan : cat = cat(52u, 99);
nyan.speak = || debug!("meow"); //~ ERROR attempted to take value of method
nyan.speak = || info!("meow"); //~ ERROR attempted to take value of method
}

View File

@ -10,5 +10,5 @@
fn main() {
#[attr] //~ ERROR expected item after attributes
debug!("hi");
info!("hi");
}

View File

@ -21,11 +21,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; //~ ERROR binary operation + cannot be applied to type `@int`
debug!(z);
info!(z);
assert_eq!(z, 21);
let forty: fish = fish{a: @40};
let two: fish = fish{a: @2};
let answer: int = forty.a + two.a; //~ ERROR binary operation + cannot be applied to type `@int`
debug!(answer);
info!(answer);
assert_eq!(answer, 42);
}

View File

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

View File

@ -17,6 +17,6 @@ fn compute1() -> float {
fn main() {
let x = compute1();
debug!(x);
info!(x);
assert_eq!(x, -4f);
}

View File

@ -17,7 +17,7 @@ enum color { rgb(int, int, int), rgba(int, int, int, int), }
fn main() {
let red: color = rgb(255, 0, 0);
match red {
rgb(r, g, b) => { debug!("rgb"); }
hsl(h, s, l) => { debug!("hsl"); }
rgb(r, g, b) => { info!("rgb"); }
hsl(h, s, l) => { info!("hsl"); }
}
}

View File

@ -21,7 +21,7 @@ fn a() {
p[0] = 5; //~ ERROR cannot assign
debug!("%d", *q);
info!("%d", *q);
}
fn borrow(_x: &[int], _f: &fn()) {}

View File

@ -18,14 +18,14 @@ fn box_imm() {
let v = ~3;
let _w = &v;
do task::spawn {
debug!("v=%d", *v);
info!("v=%d", *v);
//~^ ERROR cannot move `v` into closure
}
let v = ~3;
let _w = &v;
task::spawn(|| {
debug!("v=%d", *v);
info!("v=%d", *v);
//~^ ERROR cannot move
});
}

View File

@ -22,7 +22,7 @@ pub fn main() {
}
}
let z = copy tail[0];
debug!(fmt!("%?", z));
info!(fmt!("%?", z));
}
_ => {
::std::util::unreachable();

View File

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

View File

@ -13,5 +13,5 @@
fn main() {
return;
debug!("Paul is dead"); //~ ERROR: unreachable
info!("Paul is dead"); //~ ERROR: unreachable
}

View File

@ -1,2 +1,2 @@
// error-pattern: unresolved name `this_does_nothing_what_the`.
fn main() { debug!("doing"); this_does_nothing_what_the; debug!("boing"); }
fn main() { info!("doing"); this_does_nothing_what_the; info!("boing"); }

View File

@ -15,7 +15,7 @@ mod foo {
}
mod bar {
fn x() { debug!("x"); }
fn x() { info!("x"); }
pub fn y() { }
}

View File

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

View File

@ -13,10 +13,10 @@
use module_of_many_things::*;
mod module_of_many_things {
pub fn f1() { debug!("f1"); }
pub fn f2() { debug!("f2"); }
fn f3() { debug!("f3"); }
pub fn f4() { debug!("f4"); }
pub fn f1() { info!("f1"); }
pub fn f2() { info!("f2"); }
fn f3() { info!("f3"); }
pub fn f4() { info!("f4"); }
}

View File

@ -12,13 +12,13 @@
mod circ1 {
pub use circ2::f2;
pub fn f1() { debug!("f1"); }
pub fn f1() { info!("f1"); }
pub fn common() -> uint { return 0u; }
}
mod circ2 {
pub use circ1::f1;
pub fn f2() { debug!("f2"); }
pub fn f2() { info!("f2"); }
pub fn common() -> uint { return 1u; }
}

View File

@ -12,6 +12,6 @@
use zed::bar;
use zed::baz;
mod zed {
pub fn bar() { debug!("bar"); }
pub fn bar() { info!("bar"); }
}
fn main(args: ~[str]) { bar(); }

View File

@ -13,6 +13,6 @@ use baz::zed::bar; //~ ERROR unresolved import
mod baz {}
mod zed {
pub fn bar() { debug!("bar3"); }
pub fn bar() { info!("bar3"); }
}
fn main(args: ~[str]) { bar(); }

View File

@ -11,4 +11,4 @@
// error-pattern: unresolved
use main::bar;
fn main(args: ~[str]) { debug!("foo"); }
fn main(args: ~[str]) { info!("foo"); }

View File

@ -13,4 +13,4 @@
mod a { pub use b::foo; }
mod b { pub use a::foo; }
fn main(args: ~[str]) { debug!("loop"); }
fn main(args: ~[str]) { info!("loop"); }

View File

@ -11,5 +11,5 @@
// Regression test for issue #1448 and #1386
fn main() {
debug!("%u", 10i); //~ ERROR mismatched types
info!("%u", 10i); //~ ERROR mismatched types
}

View File

@ -10,4 +10,4 @@
// error-pattern: unresolved name `foobar`.
fn main(args: ~[str]) { debug!(foobar); }
fn main(args: ~[str]) { info!(foobar); }

View File

@ -19,7 +19,7 @@ fn main()
{
let _z = match g(1, 2) {
g(x, x) => { debug!(x + x); }
g(x, x) => { info!(x + x); }
//~^ ERROR Identifier `x` is bound more than once in the same pattern
};

View File

@ -11,6 +11,6 @@
fn main() {
let i: int;
debug!(false && { i = 5; true });
debug!(i); //~ ERROR use of possibly uninitialized variable: `i`
info!(false && { i = 5; true });
info!(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) -> ! { debug!(3); }
fn bad_bang(i: uint) -> ! { info!(3); }
fn main() { bad_bang(5u); }

View File

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

View File

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

View File

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

View File

@ -9,4 +9,4 @@
// except according to those terms.
fn force(f: &fn() -> int) -> int { f() }
fn main() { debug!(force(|| {})); } //~ ERROR mismatched types
fn main() { info!(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) { debug!(x); }
fn foo(x: int) { info!(x); }
fn main() {
let x: int; if 1 > 2 { x = 10; }

View File

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

View File

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

View File

@ -13,7 +13,7 @@ fn main() {
let y: ~int = ~42;
let mut x: ~int;
loop {
debug!(y); //~ ERROR use of moved value: `y`
info!(y); //~ ERROR use of moved value: `y`
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;
debug!(false || { i = 5; true });
debug!(i); //~ ERROR use of possibly uninitialized variable: `i`
info!(false || { i = 5; true });
info!(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) { debug!(x); }
fn foo(x: int) { info!(x); }
fn main() {
let x: int;

View File

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

View File

@ -9,8 +9,8 @@
// except according to those terms.
fn send<T:Send>(ch: _chan<T>, data: T) {
debug!(ch);
debug!(data);
info!(ch);
info!(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);
debug!(message); //~ ERROR use of moved value: `message`
info!(message); //~ ERROR use of moved value: `message`
}
fn main() { fail!(); }

View File

@ -14,7 +14,7 @@ fn test(cond: bool) {
v = 3;
break;
}
debug!("%d", v); //~ ERROR use of possibly uninitialized variable: `v`
info!("%d", v); //~ ERROR use of possibly uninitialized variable: `v`
}
fn main() {

View File

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

View File

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

View File

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

View File

@ -32,6 +32,6 @@ fn main() {
let foo = Foo { bar: [1u8, 2, 3, 4, 5], baz: 10i32 };
unsafe {
let oof: Oof<[u8, .. 5], i32> = cast::transmute(foo);
debug!(oof);
info!(oof);
}
}

View File

@ -32,6 +32,6 @@ fn main() {
let foo = Foo { bar: 1, baz: 10 };
unsafe {
let oof: Oof = cast::transmute(foo);
debug!(oof);
info!(oof);
}
}

View File

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

View File

@ -34,7 +34,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
debug!(x);
info!(x);
}
error!(*i);
}

View File

@ -33,5 +33,5 @@ fn dog() -> dog {
fn main() {
let mut d = dog();
d.chase_cat();
debug!("cats_chased: %u", d.cats_chased);
info!("cats_chased: %u", d.cats_chased);
}

View File

@ -13,6 +13,6 @@ fn wants_static_fn(_x: &'static fn()) {}
fn main() {
let i = 3;
do wants_static_fn { //~ ERROR cannot infer an appropriate lifetime due to conflicting requirements
debug!("i=%d", i);
info!("i=%d", i);
}
}

View File

@ -24,5 +24,5 @@ fn return_it<'a>() -> &'a int {
fn main() {
let x = return_it();
debug!("foo=%d", *x);
info!("foo=%d", *x);
}

View File

@ -27,5 +27,5 @@ fn return_it() -> &int {
fn main() {
let x = return_it();
debug!("foo=%d", *x);
info!("foo=%d", *x);
}

View File

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

View File

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

View File

@ -13,5 +13,5 @@
use std::libc;
fn main() {
debug!(1.0 as *libc::FILE); // Can't cast float to foreign.
info!(1.0 as *libc::FILE); // Can't cast float to foreign.
}

View File

@ -13,7 +13,7 @@
fn f() {
let v = ~[1i];
debug!(v.some_field_name); //type error
info!(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;
debug!(j);
info!(j);
}

View File

@ -9,4 +9,4 @@
// except according to those terms.
fn blk1(b: &fn()) -> @fn() { return || { }; }
fn test1() { (do blk1 { debug!("hi"); })(); }
fn test1() { (do blk1 { info!("hi"); })(); }

View File

@ -43,7 +43,7 @@ fn main() {
for 10u.times {
do task::spawn {
let result = count(5u);
debug!("result = %?", result);
info!("result = %?", result);
fail!();
};
}

View File

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

View File

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

View File

@ -19,7 +19,7 @@ fn f<A:Copy + 'static>(a: A, b: u16) -> @fn() -> (A, u16) {
pub fn main() {
let (a, b) = f(22_u64, 44u16)();
debug!("a=%? b=%?", a, b);
info!("a=%? b=%?", a, b);
assert_eq!(a, 22u64);
assert_eq!(b, 44u16);
}

View File

@ -34,7 +34,7 @@ pub fn main() {
let z = f(~x, y);
make_cycle(z);
let (a, b) = z();
debug!("a=%u b=%u", *a as uint, b as uint);
info!("a=%u b=%u", *a as uint, b as uint);
assert_eq!(*a, x);
assert_eq!(b, y);
}

View File

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

View File

@ -28,6 +28,6 @@ pub fn main() {
assert_eq!(i32_b << 1, i32_b << 1);
assert_eq!(i32_b >> 1, i32_b >> 1);
assert_eq!(i32_b & i32_b << 1, 0);
debug!(i32_b | i32_b << 1);
info!(i32_b | i32_b << 1);
assert_eq!(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() {
debug!("%?", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
debug!("%?", f(5, 6).a);
info!("%?", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
info!("%?", f(5, 6).a);
}

View File

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

View File

@ -23,7 +23,7 @@ pub fn main() {
x = @F {f: ~4};
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
info!("ptr::to_unsafe_ptr(*b_x) = %x",
ptr::to_unsafe_ptr(&(**b_x)) as uint);
assert_eq!(**b_x, 3);
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(**b_x)));

View File

@ -28,7 +28,7 @@ pub fn main() {
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
x = @F {f: ~4};
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
info!("ptr::to_unsafe_ptr(*b_x) = %x",
ptr::to_unsafe_ptr(&(*b_x)) as uint);
assert_eq!(*b_x, 3);
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));

View File

@ -23,7 +23,7 @@ pub fn main() {
*x = @F {f: ~4};
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
info!("ptr::to_unsafe_ptr(*b_x) = %x",
ptr::to_unsafe_ptr(&(**b_x)) as uint);
assert_eq!(**b_x, 3);
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(**b_x)));

View File

@ -28,7 +28,7 @@ pub fn main() {
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
*x = @F{f: ~4};
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
info!("ptr::to_unsafe_ptr(*b_x) = %x",
ptr::to_unsafe_ptr(&(*b_x)) as uint);
assert_eq!(*b_x, 3);
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));

View File

@ -26,7 +26,7 @@ pub fn main() {
assert_eq!(ptr::to_unsafe_ptr(&(*x)), ptr::to_unsafe_ptr(&(*b_x)));
x = @22;
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
info!("ptr::to_unsafe_ptr(*b_x) = %x",
ptr::to_unsafe_ptr(&(*b_x)) as uint);
assert_eq!(*b_x, 3);
assert!(ptr::to_unsafe_ptr(&(*x)) != ptr::to_unsafe_ptr(&(*b_x)));

View File

@ -25,13 +25,13 @@ fn testfn(cond: bool) {
exp = 4;
}
debug!("*r = %d, exp = %d", *r, exp);
info!("*r = %d, exp = %d", *r, exp);
assert_eq!(*r, exp);
x = @5;
y = @6;
debug!("*r = %d, exp = %d", *r, exp);
info!("*r = %d, exp = %d", *r, exp);
assert_eq!(*r, exp);
}

View File

@ -28,7 +28,7 @@ pub fn main() {
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
x = @F {f: ~4};
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
info!("ptr::to_unsafe_ptr(*b_x) = %x",
ptr::to_unsafe_ptr(&(*b_x)) as uint);
assert_eq!(*b_x, 3);
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));

View File

@ -17,6 +17,6 @@ fn unbox<T:Copy>(b: Box<T>) -> T { return copy *b.c; }
pub fn main() {
let foo: int = 17;
let bfoo: Box<int> = Box {c: @foo};
debug!("see what's in our box");
info!("see what's in our box");
assert_eq!(unbox::<int>(bfoo), foo);
}

View File

@ -12,5 +12,5 @@ use std::borrow;
pub fn main() {
let x = 3;
debug!("&x=%x", borrow::to_uint(&x));
info!("&x=%x", borrow::to_uint(&x));
}

View File

@ -17,6 +17,6 @@ use cci_borrow_lib::foo;
pub fn main() {
let p = @22u;
let r = foo(p);
debug!("r=%u", r);
info!("r=%u", r);
assert_eq!(r, 22u);
}

View File

@ -16,13 +16,13 @@ use cci_impl_lib::uint_helpers;
pub fn main() {
//let bt0 = sys::frame_address();
//debug!("%?", bt0);
//info!("%?", bt0);
do 3u.to(10u) |i| {
print(fmt!("%u\n", i));
//let bt1 = sys::frame_address();
//debug!("%?", bt1);
//info!("%?", bt1);
//assert!(bt0 == bt1);
}
}

View File

@ -15,7 +15,7 @@ extern mod cci_iter_lib;
pub fn main() {
//let bt0 = sys::rusti::frame_address(1u32);
//debug!("%?", bt0);
//info!("%?", bt0);
do cci_iter_lib::iter(~[1, 2, 3]) |i| {
print(fmt!("%d", *i));
//assert!(bt0 == sys::rusti::frame_address(2u32));

View File

@ -21,12 +21,12 @@ pub fn main() {
// sys::frame_address() to determine if we are inlining is
// actually working.
//let bt0 = sys::frame_address();
//debug!("%?", bt0);
//info!("%?", bt0);
do iter(~[1u, 2u, 3u]) |i| {
print(fmt!("%u\n", i));
//let bt1 = sys::frame_address();
//debug!("%?", bt1);
//info!("%?", bt1);
//assert!(bt0 != bt1);
}

View File

@ -16,7 +16,7 @@ use cci_class_cast::kitty::*;
fn print_out(thing: @ToStr, expected: ~str) {
let actual = thing.to_str();
debug!("%s", actual);
info!("%s", actual);
assert_eq!(actual, expected);
}

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