Skip to content

Commit eabeba3

Browse files
committed
added index to test cases, more debugging output
1 parent 1ecc1e5 commit eabeba3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/libsyntax/ext/expand.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,13 +1794,13 @@ mod test {
17941794
// create a really evil test case where a $x appears inside a binding of $x
17951795
// but *shouldnt* bind because it was inserted by a different macro....
17961796
];
1797-
for s in tests.iter() {
1798-
run_renaming_test(s);
1797+
for (idx,s) in tests.iter().enumerate() {
1798+
run_renaming_test(s,idx);
17991799
}
18001800
}
18011801

18021802
// run one of the renaming tests
1803-
fn run_renaming_test(t : &renaming_test) {
1803+
fn run_renaming_test(t : &renaming_test, test_idx: uint) {
18041804
let invalid_name = token::special_idents::invalid.name;
18051805
let (teststr, bound_connections, bound_ident_check) = match *t {
18061806
(ref str,ref conns, bic) => (str.to_managed(), conns.clone(), bic)
@@ -1845,8 +1845,15 @@ mod test {
18451845
&& (mtwt_resolve(varref.segments[0].identifier) == binding_name);
18461846
// temp debugging:
18471847
if (fail) {
1848-
std::io::println("uh oh, matches but shouldn't:");
1848+
println!("failure on test {}",test_idx);
1849+
println!("text of test case: \"{}\"", teststr);
1850+
println!("");
1851+
println!("uh oh, matches but shouldn't:");
18491852
std::io::println(fmt!("varref: %?",varref));
1853+
// good lord, you can't make a path with 0 segments, can you?
1854+
println!("varref's first segment's uint: {}, and string: \"{}\"",
1855+
varref.segments[0].identifier.name,
1856+
ident_to_str(&varref.segments[0].identifier));
18501857
std::io::println(fmt!("binding: %?", bindings[binding_idx]));
18511858
ast_util::display_sctable(get_sctable());
18521859
}

0 commit comments

Comments
 (0)