]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/macro_rules-matchers.rs
remove unnecessary string searchings
[rust.git] / src / test / rustdoc / macro_rules-matchers.rs
1 // This is a regression test for issue #86208.
2 // It is also a general test of macro_rules! display.
3
4 #![crate_name = "foo"]
5
6 // @has 'foo/macro.todo.html'
7 // @has - '//span[@class="macro"]' 'macro_rules!'
8 // @has - '//span[@class="ident"]' 'todo'
9
10 // @has - '{ () => { ... }; ($('
11 // @has - '//span[@class="macro-nonterminal"]' '$'
12 // @has - '//span[@class="macro-nonterminal"]' 'arg'
13 // @has - ':'
14 // @has - '//span[@class="ident"]' 'tt'
15 // @has - ')+'
16 // @has - ') => { ... }; }'
17 pub use std::todo;
18
19 mod mod1 {
20     // @has 'foo/macro.macro1.html'
21     // @has - 'macro_rules!'
22     // @has - 'macro1'
23     // @has - '{ () => { ... }; ($('
24     // @has - '//span[@class="macro-nonterminal"]' '$'
25     // @has - '//span[@class="macro-nonterminal"]' 'arg'
26     // @has - ':'
27     // @has - 'expr'
28     // @has - '),'
29     // @has - '+'
30     // @has - ') => { ... }; }'
31     #[macro_export]
32     macro_rules! macro1 {
33         () => {};
34         ($($arg:expr),+) => { stringify!($($arg),+) };
35     }
36 }