Replace all ~"" with "".to_owned()

This commit is contained in:
Richo Healey
2014-04-15 18:17:48 -07:00
committed by Brian Anderson
parent b75683cadf
commit 919889a1d6
383 changed files with 2906 additions and 2813 deletions

View File

@@ -947,24 +947,24 @@ mod test {
#[test] fn ident_transformation () {
let mut zz_fold = ToZzIdentFolder;
let ast = string_to_crate(
~"#[a] mod b {fn c (d : e, f : g) {h!(i,j,k);l;m}}");
"#[a] mod b {fn c (d : e, f : g) {h!(i,j,k);l;m}}".to_owned());
let folded_crate = zz_fold.fold_crate(ast);
assert_pred!(matches_codepattern,
"matches_codepattern",
pprust::to_str(|s| fake_print_crate(s, &folded_crate)),
~"#[a]mod zz{fn zz(zz:zz,zz:zz){zz!(zz,zz,zz);zz;zz}}");
"#[a]mod zz{fn zz(zz:zz,zz:zz){zz!(zz,zz,zz);zz;zz}}".to_owned());
}
// even inside macro defs....
#[test] fn ident_transformation_in_defs () {
let mut zz_fold = ToZzIdentFolder;
let ast = string_to_crate(
~"macro_rules! a {(b $c:expr $(d $e:token)f+ => \
(g $(d $d $e)+))} ");
"macro_rules! a {(b $c:expr $(d $e:token)f+ => \
(g $(d $d $e)+))} ".to_owned());
let folded_crate = zz_fold.fold_crate(ast);
assert_pred!(matches_codepattern,
"matches_codepattern",
pprust::to_str(|s| fake_print_crate(s, &folded_crate)),
~"zz!zz((zz$zz:zz$(zz $zz:zz)zz+=>(zz$(zz$zz$zz)+)))");
"zz!zz((zz$zz:zz$(zz $zz:zz)zz+=>(zz$(zz$zz$zz)+)))".to_owned());
}
}