Skip to content

Commit 53a6881

Browse files
committed
new test that uncovers bug in fold
1 parent a42e36a commit 53a6881

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/libsyntax/fold.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,4 +1019,15 @@ mod test {
10191019
token::get_ident_interner()),
10201020
~"zz!zz((zz$zz:zz$(zz $zz:zz)zz+=>(zz$(zz$zz$zz)+)))");
10211021
}
1022+
1023+
// and in cast expressions... this appears to be an existing bug.
1024+
#[test] fn ident_transformation_in_types () {
1025+
let zz_fold = fun_to_ident_folder(to_zz());
1026+
let ast = string_to_crate(@"fn a() {let z = 13 as int;}");
1027+
assert_pred!(matches_codepattern,
1028+
"matches_codepattern",
1029+
pprust::to_str(&zz_fold.fold_crate(ast),fake_print_crate,
1030+
token::get_ident_interner()),
1031+
~"fn zz(){let zz=13 as zz;}");
1032+
}
10221033
}

0 commit comments

Comments
 (0)