diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2021-06-13 17:15:45 -0700 |
|---|---|---|
| committer | Noah Lev <camelidcamel@gmail.com> | 2021-06-28 20:01:15 -0700 |
| commit | f749d97b8a1fdea250642f9f92d050452a081d37 (patch) | |
| tree | a869e4423c36a5d78745dedf0312077bcd929d5e | |
| parent | 18db83fde5192252fa17188ebb13bf48679db01f (diff) | |
| download | rust-f749d97b8a1fdea250642f9f92d050452a081d37.tar.gz rust-f749d97b8a1fdea250642f9f92d050452a081d37.zip | |
Add regression test for #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.
| -rw-r--r-- | src/test/rustdoc/macro_rules-matchers.rs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/test/rustdoc/macro_rules-matchers.rs b/src/test/rustdoc/macro_rules-matchers.rs new file mode 100644 index 00000000000..e3550aea472 --- /dev/null +++ b/src/test/rustdoc/macro_rules-matchers.rs @@ -0,0 +1,42 @@ +// This is a regression test for issue #86208. +// It is also a general test of macro_rules! display. + +#![crate_name = "foo"] + +// @has 'foo/macro.todo.html' +// @has - '//span[@class="macro"]' 'macro_rules!' +// @has - '//span[@class="ident"]' 'todo' +// Note: count = 2 * ('=' + '>') + '+' = 2 * (1 + 1) + 1 = 5 +// @count - '//span[@class="op"]' 5 + +// @has - '{ ()' +// @has - '//span[@class="op"]' '=' +// @has - '//span[@class="op"]' '>' +// @has - '{ ... };' + +// @has - '($(' +// @has - '//span[@class="macro-nonterminal"]' '$' +// @has - '//span[@class="macro-nonterminal"]' 'arg' +// @has - ':' +// @has - '//span[@class="ident"]' 'tt' +// @has - '//span[@class="op"]' '+' +// @has - ')' +pub use std::todo; + +mod mod1 { + // @has 'foo/macro.macro1.html' + // @has - 'macro_rules!' + // @has - 'macro1' + // @has - '{ ()' + // @has - '($(' + // @has - 'arg' + // @has - 'expr' + // @has - ',' + // @has - '+' + // @has - ')' + #[macro_export] + macro_rules! macro1 { + () => {}; + ($($arg:expr),+) => { stringify!($($arg),+) }; + } +} |
