We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d459912 commit 6c75284Copy full SHA for 6c75284
1 file changed
rust/src/main.rs
@@ -289,6 +289,19 @@ fn mutable_function_argument() {
289
assert_eq!(a, "abcd");
290
}
291
292
+#[test]
293
+fn macro_test() {
294
+ macro_rules! sample_macro {
295
+ // `()` indicates that the macro takes no argument.
296
+ () => { 0 };
297
+ ($a:expr) => { $a };
298
+ ($a:expr, $b:expr) => { $a + $b }
299
+ }
300
+ assert_eq!(sample_macro!(), 0);
301
+ assert_eq!(sample_macro!(1), 1);
302
+ assert_eq!(sample_macro!(1, 2), 3);
303
+}
304
+
305
#[test]
306
#[ignore]
307
fn failing_test() {
0 commit comments