about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIshan Jain <contact@ishanjain.me>2024-06-19 16:11:50 +0530
committerIshan Jain <contact@ishanjain.me>2024-06-19 16:11:50 +0530
commit33d4ab65e81e7be0357b76833841ae2a054e95e8 (patch)
treed7f547dc0c57162af22e4702079f001d57f210d9
parent9b619035b9d1e13dc24679a5424af484a598131a (diff)
downloadrust-33d4ab65e81e7be0357b76833841ae2a054e95e8.tar.gz
rust-33d4ab65e81e7be0357b76833841ae2a054e95e8.zip
updated tests
-rw-r--r--src/tools/rust-analyzer/crates/ide/src/expand_macro.rs31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/tools/rust-analyzer/crates/ide/src/expand_macro.rs b/src/tools/rust-analyzer/crates/ide/src/expand_macro.rs
index 55838799f6e..e3bb159daf4 100644
--- a/src/tools/rust-analyzer/crates/ide/src/expand_macro.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/expand_macro.rs
@@ -230,29 +230,26 @@ mod tests {
     }
 
     #[test]
-    fn only_expand_allowed_builtin_macro() {
-        let fail_tests = [r#"
-        //- minicore: asm
-        $0asm!("0x300, x0");
-            "#];
-
-        for test in fail_tests {
-            let (analysis, pos) = fixture::position(test);
-            let expansion = analysis.expand_macro(pos).unwrap();
-            assert!(expansion.is_none());
-        }
-
-        let tests = [(
+    fn expand_allowed_builtin_macro() {
+        check(
             r#"
             //- minicore: concat
             $0concat!("test", 10, 'b', true);"#,
             expect![[r#"
                 concat!
                 "test10btrue""#]],
-        )];
-        for (test, expect) in tests {
-            check(test, expect);
-        }
+        );
+    }
+
+    #[test]
+    fn do_not_expand_disallowed_macro() {
+        let (analysis, pos) = fixture::position(
+            r#"
+        //- minicore: asm
+        $0asm!("0x300, x0");"#,
+        );
+        let expansion = analysis.expand_macro(pos).unwrap();
+        assert!(expansion.is_none());
     }
 
     #[test]