]> git.lizzy.rs Git - rust.git/commitdiff
move test
authorAleksey Kladov <aleksey.kladov@gmail.com>
Sun, 10 Oct 2021 09:55:31 +0000 (12:55 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Sun, 10 Oct 2021 09:55:31 +0000 (12:55 +0300)
crates/hir_def/src/macro_expansion_tests/mbe.rs
crates/mbe/src/tests/expand.rs

index 3ac8f706b6ed0b1100ccc273b51297a2ee0808ee..1cad690bee06d39c67382ceb7447b6193b488832 100644 (file)
@@ -1272,3 +1272,21 @@ macro_rules! m {
 "#]],
     );
 }
+
+#[test]
+fn test_boolean_is_ident() {
+    check(
+        r#"
+macro_rules! m {
+    ($lit0:literal, $lit1:literal) => { const VALUE: (bool, bool) = ($lit0, $lit1); };
+}
+m!(true, false);
+"#,
+        expect![[r#"
+macro_rules! m {
+    ($lit0:literal, $lit1:literal) => { const VALUE: (bool, bool) = ($lit0, $lit1); };
+}
+const VALUE: (bool, bool) = (true , false );
+"#]],
+    );
+}
index 67543df5838c2dad8f9be9630b01846d79e53ffc..306db3c085faad769d14c136d64272a63fbc2a4f 100644 (file)
@@ -101,36 +101,6 @@ fn test_attr_to_token_tree() {
     );
 }
 
-#[test]
-fn test_boolean_is_ident() {
-    parse_macro(
-        r#"
-        macro_rules! foo {
-              ($lit0:literal, $lit1:literal) => { const VALUE: (bool,bool) = ($lit0,$lit1); };
-        }
-"#,
-    )
-    .assert_expand(
-        r#"foo!(true,false);"#,
-        r#"
-SUBTREE $
-  IDENT   const 14
-  IDENT   VALUE 15
-  PUNCH   : [alone] 16
-  SUBTREE () 17
-    IDENT   bool 18
-    PUNCH   , [alone] 19
-    IDENT   bool 20
-  PUNCH   = [alone] 21
-  SUBTREE () 22
-    IDENT   true 29
-    PUNCH   , [joint] 25
-    IDENT   false 31
-  PUNCH   ; [alone] 28
-"#,
-    );
-}
-
 #[test]
 fn test_vis() {
     parse_macro(