diff options
| author | John Clements <clements@racket-lang.org> | 2013-09-05 13:28:57 -0700 |
|---|---|---|
| committer | John Clements <clements@racket-lang.org> | 2013-09-06 13:35:14 -0700 |
| commit | eabeba3ef309b09a1acd8adfbca13203a0766d75 (patch) | |
| tree | 73c4893ddc9b081dd527ad3e83bffbbff8e7edbf /src/libsyntax | |
| parent | 1ecc1e51c08f38b6ee42dae9a0f8bd6dc1f1b86f (diff) | |
| download | rust-eabeba3ef309b09a1acd8adfbca13203a0766d75.tar.gz rust-eabeba3ef309b09a1acd8adfbca13203a0766d75.zip | |
added index to test cases, more debugging output
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 5f57eba5b4c..cde418ca991 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1794,13 +1794,13 @@ mod test { // create a really evil test case where a $x appears inside a binding of $x // but *shouldnt* bind because it was inserted by a different macro.... ]; - for s in tests.iter() { - run_renaming_test(s); + for (idx,s) in tests.iter().enumerate() { + run_renaming_test(s,idx); } } // run one of the renaming tests - fn run_renaming_test(t : &renaming_test) { + fn run_renaming_test(t : &renaming_test, test_idx: uint) { let invalid_name = token::special_idents::invalid.name; let (teststr, bound_connections, bound_ident_check) = match *t { (ref str,ref conns, bic) => (str.to_managed(), conns.clone(), bic) @@ -1845,8 +1845,15 @@ mod test { && (mtwt_resolve(varref.segments[0].identifier) == binding_name); // temp debugging: if (fail) { - std::io::println("uh oh, matches but shouldn't:"); + println!("failure on test {}",test_idx); + println!("text of test case: \"{}\"", teststr); + println!(""); + println!("uh oh, matches but shouldn't:"); std::io::println(fmt!("varref: %?",varref)); + // good lord, you can't make a path with 0 segments, can you? + println!("varref's first segment's uint: {}, and string: \"{}\"", + varref.segments[0].identifier.name, + ident_to_str(&varref.segments[0].identifier)); std::io::println(fmt!("binding: %?", bindings[binding_idx])); ast_util::display_sctable(get_sctable()); } |
