@@ -27,7 +27,7 @@ fn test_derive_error() {
27
27
}
28
28
29
29
#[ test]
30
- fn test_fn_like_macro ( ) {
30
+ fn test_fn_like_macro_noop ( ) {
31
31
assert_expand (
32
32
"fn_like_noop" ,
33
33
r#"ident, 0, 1, []"# ,
@@ -44,7 +44,7 @@ fn test_fn_like_macro() {
44
44
}
45
45
46
46
#[ test]
47
- fn test_fn_like_macro2 ( ) {
47
+ fn test_fn_like_macro_clone_ident_subtree ( ) {
48
48
assert_expand (
49
49
"fn_like_clone_tokens" ,
50
50
r#"ident, []"# ,
@@ -56,6 +56,46 @@ fn test_fn_like_macro2() {
56
56
) ;
57
57
}
58
58
59
+ #[ test]
60
+ fn test_fn_like_macro_clone_literals ( ) {
61
+ assert_expand (
62
+ "fn_like_clone_tokens" ,
63
+ r#"1u16, 2_u32, -4i64, 3.14f32, "hello bridge""# ,
64
+ expect ! [ [ r#"
65
+ SUBTREE $
66
+ LITERAL 1u16 4294967295
67
+ PUNCH , [alone] 4294967295
68
+ LITERAL 2_u32 4294967295
69
+ PUNCH , [alone] 4294967295
70
+ PUNCH - [alone] 4294967295
71
+ LITERAL 4i64 4294967295
72
+ PUNCH , [alone] 4294967295
73
+ LITERAL 3.14f32 4294967295
74
+ PUNCH , [alone] 4294967295
75
+ LITERAL "hello bridge" 4294967295"# ] ] ,
76
+ ) ;
77
+ }
78
+
79
+ #[ test]
80
+ fn test_fn_like_macro_clone_literals ( ) {
81
+ assert_expand (
82
+ "fn_like_clone_tokens" ,
83
+ r#"1u16, 2_u32, -4i64, 3.14f32, "hello bridge""# ,
84
+ expect ! [ [ r#"
85
+ SUBTREE $
86
+ LITERAL 1u16 4294967295
87
+ PUNCH , [alone] 4294967295
88
+ LITERAL 2_u32 4294967295
89
+ PUNCH , [alone] 4294967295
90
+ PUNCH - [alone] 4294967295
91
+ LITERAL 4i64 4294967295
92
+ PUNCH , [alone] 4294967295
93
+ LITERAL 3.14f32 4294967295
94
+ PUNCH , [alone] 4294967295
95
+ LITERAL "hello bridge" 4294967295"# ] ] ,
96
+ ) ;
97
+ }
98
+
59
99
#[ test]
60
100
fn test_attr_macro ( ) {
61
101
// Corresponds to
0 commit comments