Add regression test for macro call highlighting
This commit is contained in:
parent
61b5382ad8
commit
31c4ad33cc
1 changed files with 29 additions and 0 deletions
29
tests/rustdoc-html/source-code-pages/macro-call.rs
Normal file
29
tests/rustdoc-html/source-code-pages/macro-call.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// This is yet another test to ensure that only macro calls are considered as such
|
||||
// by the rustdoc highlighter.
|
||||
// This is a regression test for <https://github.com/rust-lang/rust/issues/151904>.
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
//@ has src/foo/macro-call.rs.html
|
||||
//@ count - '//code/span[@class="macro"]' 2
|
||||
//@ has - '//code/span[@class="macro"]' 'panic!'
|
||||
//@ has - '//code/span[@class="macro"]' 'macro_rules!'
|
||||
|
||||
pub struct Layout;
|
||||
|
||||
impl Layout {
|
||||
pub fn new<X: std::fmt::Debug>() {}
|
||||
}
|
||||
|
||||
pub fn bar() {
|
||||
let layout = Layout::new::<u32>();
|
||||
if layout != Layout::new::<u32>() {
|
||||
panic!();
|
||||
}
|
||||
let macro_rules = 3;
|
||||
if macro_rules != 3 {}
|
||||
}
|
||||
|
||||
macro_rules! blob {
|
||||
() => {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue