Skip to content

Commit f749d97

Browse files
committed
Add regression test for rust-lang#86208
This test does not test the output as well as I would like, but I think I am limited by htmldocck. I would really just like to strip all the HTML tags from the output for the sake of the different `@has` checks, but that doesn't seem to be currently possible.
1 parent 18db83f commit f749d97

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
// Note: count = 2 * ('=' + '>') + '+' = 2 * (1 + 1) + 1 = 5
10+
// @count - '//span[@class="op"]' 5
11+
12+
// @has - '{ ()'
13+
// @has - '//span[@class="op"]' '='
14+
// @has - '//span[@class="op"]' '>'
15+
// @has - '{ ... };'
16+
17+
// @has - '($('
18+
// @has - '//span[@class="macro-nonterminal"]' '$'
19+
// @has - '//span[@class="macro-nonterminal"]' 'arg'
20+
// @has - ':'
21+
// @has - '//span[@class="ident"]' 'tt'
22+
// @has - '//span[@class="op"]' '+'
23+
// @has - ')'
24+
pub use std::todo;
25+
26+
mod mod1 {
27+
// @has 'foo/macro.macro1.html'
28+
// @has - 'macro_rules!'
29+
// @has - 'macro1'
30+
// @has - '{ ()'
31+
// @has - '($('
32+
// @has - 'arg'
33+
// @has - 'expr'
34+
// @has - ','
35+
// @has - '+'
36+
// @has - ')'
37+
#[macro_export]
38+
macro_rules! macro1 {
39+
() => {};
40+
($($arg:expr),+) => { stringify!($($arg),+) };
41+
}
42+
}

0 commit comments

Comments
 (0)