Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/proc-macro-srv/src/tests/mod.rs')
| -rw-r--r-- | crates/proc-macro-srv/src/tests/mod.rs | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/crates/proc-macro-srv/src/tests/mod.rs b/crates/proc-macro-srv/src/tests/mod.rs index 6334282538..dc6e71163b 100644 --- a/crates/proc-macro-srv/src/tests/mod.rs +++ b/crates/proc-macro-srv/src/tests/mod.rs @@ -21,20 +21,20 @@ fn test_derive_error() { assert_expand( "DeriveError", r#"struct S;"#, - expect![[r##" + expect![[r#" SUBTREE $$ 1 1 IDENT compile_error 1 PUNCH ! [alone] 1 SUBTREE () 1 1 - LITERAL "#[derive(DeriveError)] struct S ;"1 - PUNCH ; [alone] 1"##]], - expect![[r##" + LITERAL Str #[derive(DeriveError)] struct S ; 1 + PUNCH ; [alone] 1"#]], + expect![[r#" SUBTREE $$ 42:[email protected]#0 42:[email protected]#0 IDENT compile_error 42:[email protected]#0 PUNCH ! [alone] 42:[email protected]#0 SUBTREE () 42:[email protected]#0 42:[email protected]#0 - LITERAL "#[derive(DeriveError)] struct S ;"42:[email protected]#0 - PUNCH ; [alone] 42:[email protected]#0"##]], + LITERAL Str #[derive(DeriveError)] struct S ; 42:[email protected]#0 + PUNCH ; [alone] 42:[email protected]#0"#]], ); } @@ -47,18 +47,18 @@ fn test_fn_like_macro_noop() { SUBTREE $$ 1 1 IDENT ident 1 PUNCH , [alone] 1 - LITERAL 01 + LITERAL Integer 0 1 PUNCH , [alone] 1 - LITERAL 11 + LITERAL Integer 1 1 PUNCH , [alone] 1 SUBTREE [] 1 1"#]], expect![[r#" SUBTREE $$ 42:[email protected]#0 42:[email protected]#0 IDENT ident 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 - LITERAL 042:[email protected]#0 + LITERAL Integer 0 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 - LITERAL 142:[email protected]#0 + LITERAL Integer 1 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 SUBTREE [] 42:[email protected]#0 42:[email protected]#0"#]], ); @@ -135,22 +135,22 @@ fn test_fn_like_mk_literals() { r#""#, expect![[r#" SUBTREE $$ 1 1 - LITERAL b"byte_string"1 - LITERAL 'c'1 - LITERAL "string"1 - LITERAL 3.14f641 - LITERAL 3.141 - LITERAL 123i641 - LITERAL 1231"#]], + LITERAL ByteStr byte_string 1 + LITERAL Char c 1 + LITERAL Str string 1 + LITERAL Float 3.14f64 1 + LITERAL Float 3.14 1 + LITERAL Integer 123i64 1 + LITERAL Integer 123 1"#]], expect![[r#" SUBTREE $$ 42:[email protected]#0 42:[email protected]#0 - LITERAL b"byte_string"42:[email protected]#0 - LITERAL 'c'42:[email protected]#0 - LITERAL "string"42:[email protected]#0 - LITERAL 3.14f6442:[email protected]#0 - LITERAL 3.1442:[email protected]#0 - LITERAL 123i6442:[email protected]#0 - LITERAL 12342:[email protected]#0"#]], + LITERAL ByteStr byte_string 42:[email protected]#0 + LITERAL Char c 42:[email protected]#0 + LITERAL Str string 42:[email protected]#0 + LITERAL Float 3.14f64 42:[email protected]#0 + LITERAL Float 3.14 42:[email protected]#0 + LITERAL Integer 123i64 42:[email protected]#0 + LITERAL Integer 123 42:[email protected]#0"#]], ); } @@ -175,50 +175,50 @@ fn test_fn_like_macro_clone_literals() { assert_expand( "fn_like_clone_tokens", r###"1u16, 2_u32, -4i64, 3.14f32, "hello bridge", "suffixed"suffix, r##"raw"##, 'a', b'b', c"null""###, - expect![[r###" + expect![[r#" SUBTREE $$ 1 1 - LITERAL 1u161 + LITERAL Integer 1u16 1 PUNCH , [alone] 1 - LITERAL 2_u321 + LITERAL Integer 2_u32 1 PUNCH , [alone] 1 PUNCH - [alone] 1 - LITERAL 4i641 + LITERAL Integer 4i64 1 PUNCH , [alone] 1 - LITERAL 3.14f321 + LITERAL Float 3.14f32 1 PUNCH , [alone] 1 - LITERAL "hello bridge"1 + LITERAL Str hello bridge 1 PUNCH , [alone] 1 - LITERAL "suffixed"suffix1 + LITERAL Str suffixedsuffix 1 PUNCH , [alone] 1 - LITERAL r##"raw"##1 + LITERAL StrRaw(2) raw 1 PUNCH , [alone] 1 - LITERAL 'a'1 + LITERAL Char a 1 PUNCH , [alone] 1 - LITERAL b'b'1 + LITERAL Byte b 1 PUNCH , [alone] 1 - LITERAL c"null"1"###]], - expect![[r###" + LITERAL CStr null 1"#]], + expect![[r#" SUBTREE $$ 42:[email protected]#0 42:[email protected]#0 - LITERAL 1u1642:[email protected]#0 + LITERAL Integer 1u16 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 - LITERAL 2_u3242:[email protected]#0 + LITERAL Integer 2_u32 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 PUNCH - [alone] 42:[email protected]#0 - LITERAL 4i6442:[email protected]#0 + LITERAL Integer 4i64 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 - LITERAL 3.14f3242:[email protected]#0 + LITERAL Float 3.14f32 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 - LITERAL "hello bridge"42:[email protected]#0 + LITERAL Str hello bridge 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 - LITERAL "suffixed"suffix42:[email protected]#0 + LITERAL Str suffixedsuffix 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 - LITERAL r##"raw"##42:[email protected]#0 + LITERAL StrRaw(2) raw 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 - LITERAL 'a'42:[email protected]#0 + LITERAL Char a 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 - LITERAL b'b'42:[email protected]#0 + LITERAL Byte b 42:[email protected]#0 PUNCH , [alone] 42:[email protected]#0 - LITERAL c"null"42:[email protected]#0"###]], + LITERAL CStr null 42:[email protected]#0"#]], ); } @@ -231,20 +231,20 @@ fn test_attr_macro() { "attr_error", r#"mod m {}"#, r#"some arguments"#, - expect![[r##" + expect![[r#" SUBTREE $$ 1 1 IDENT compile_error 1 PUNCH ! [alone] 1 SUBTREE () 1 1 - LITERAL "#[attr_error(some arguments)] mod m {}"1 - PUNCH ; [alone] 1"##]], - expect![[r##" + LITERAL Str #[attr_error(some arguments)] mod m {} 1 + PUNCH ; [alone] 1"#]], + expect![[r#" SUBTREE $$ 42:[email protected]#0 42:[email protected]#0 IDENT compile_error 42:[email protected]#0 PUNCH ! [alone] 42:[email protected]#0 SUBTREE () 42:[email protected]#0 42:[email protected]#0 - LITERAL "#[attr_error(some arguments)] mod m {}"42:[email protected]#0 - PUNCH ; [alone] 42:[email protected]#0"##]], + LITERAL Str #[attr_error(some arguments)] mod m {} 42:[email protected]#0 + PUNCH ; [alone] 42:[email protected]#0"#]], ); } |