diff options
Diffstat (limited to 'src/libsyntax/parse/mod.rs')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index eca9f955d93..4586980d893 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -302,7 +302,7 @@ mod test { } #[test] fn path_exprs_1() { - assert!(string_to_expr(~"a") == + assert!(string_to_expr("a".to_owned()) == @ast::Expr{ id: ast::DUMMY_NODE_ID, node: ast::ExprPath(ast::Path { @@ -321,7 +321,7 @@ mod test { } #[test] fn path_exprs_2 () { - assert!(string_to_expr(~"::a::b") == + assert!(string_to_expr("::a::b".to_owned()) == @ast::Expr { id: ast::DUMMY_NODE_ID, node: ast::ExprPath(ast::Path { @@ -346,12 +346,12 @@ mod test { #[should_fail] #[test] fn bad_path_expr_1() { - string_to_expr(~"::abc::def::return"); + string_to_expr("::abc::def::return".to_owned()); } // check the token-tree-ization of macros #[test] fn string_to_tts_macro () { - let tts = string_to_tts(~"macro_rules! zip (($a)=>($a))"); + let tts = string_to_tts("macro_rules! zip (($a)=>($a))".to_owned()); let tts: &[ast::TokenTree] = tts.as_slice(); match tts { [ast::TTTok(_,_), @@ -404,9 +404,9 @@ mod test { } #[test] fn string_to_tts_1 () { - let tts = string_to_tts(~"fn a (b : int) { b; }"); + let tts = string_to_tts("fn a (b : int) { b; }".to_owned()); assert_eq!(to_json_str(&tts), - ~"[\ + "[\ {\ \"variant\":\"TTTok\",\ \"fields\":[\ @@ -528,12 +528,12 @@ mod test { ]\ ]\ }\ -]" +]".to_owned() ); } #[test] fn ret_expr() { - assert!(string_to_expr(~"return d") == + assert!(string_to_expr("return d".to_owned()) == @ast::Expr{ id: ast::DUMMY_NODE_ID, node:ast::ExprRet(Some(@ast::Expr{ @@ -556,7 +556,7 @@ mod test { } #[test] fn parse_stmt_1 () { - assert!(string_to_stmt(~"b;") == + assert!(string_to_stmt("b;".to_owned()) == @Spanned{ node: ast::StmtExpr(@ast::Expr { id: ast::DUMMY_NODE_ID, @@ -583,7 +583,7 @@ mod test { #[test] fn parse_ident_pat () { let sess = new_parse_sess(); - let mut parser = string_to_parser(&sess, ~"b"); + let mut parser = string_to_parser(&sess, "b".to_owned()); assert!(parser.parse_pat() == @ast::Pat{id: ast::DUMMY_NODE_ID, node: ast::PatIdent( @@ -607,7 +607,7 @@ mod test { // check the contents of the tt manually: #[test] fn parse_fundecl () { // this test depends on the intern order of "fn" and "int" - assert!(string_to_item(~"fn a (b : int) { b; }") == + assert!(string_to_item("fn a (b : int) { b; }".to_owned()) == Some( @ast::Item{ident:str_to_ident("a"), attrs:Vec::new(), @@ -699,12 +699,12 @@ mod test { #[test] fn parse_exprs () { // just make sure that they parse.... - string_to_expr(~"3 + 4"); - string_to_expr(~"a::z.froob(b,@(987+3))"); + string_to_expr("3 + 4".to_owned()); + string_to_expr("a::z.froob(b,@(987+3))".to_owned()); } #[test] fn attrs_fix_bug () { - string_to_item(~"pub fn mk_file_writer(path: &Path, flags: &[FileFlag]) + string_to_item("pub fn mk_file_writer(path: &Path, flags: &[FileFlag]) -> Result<@Writer, ~str> { #[cfg(windows)] fn wb() -> c_int { @@ -715,7 +715,7 @@ mod test { fn wb() -> c_int { O_WRONLY as c_int } let mut fflags: c_int = wb(); -}"); +}".to_owned()); } } |
