Skip to content

Commit 2b98060

Browse files
Add search test for new macro kinds
1 parent 8bd80ca commit 2b98060

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

tests/rustdoc-js/macro-kinds.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// exact-check
2+
const EXPECTED = [
3+
{
4+
'query': 'macro:macro',
5+
'others': [
6+
{ 'path': 'macro_kinds', 'name': 'macro1' },
7+
{ 'path': 'macro_kinds', 'name': 'macro3' },
8+
],
9+
},
10+
{
11+
'query': 'attr:macro',
12+
'others': [
13+
{ 'path': 'macro_kinds', 'name': 'macro1' },
14+
{ 'path': 'macro_kinds', 'name': 'macro2' },
15+
],
16+
},
17+
];

tests/rustdoc-js/macro-kinds.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Test which ensures that attribute macros are correctly handled by the search.
2+
// For example: `macro1` should appear in both `attr` and `macro` filters whereas
3+
// `macro2` and `macro3` should only appear in `attr` or `macro` filters respectively.
4+
5+
#![feature(macro_attr)]
6+
7+
#[macro_export]
8+
macro_rules! macro1 {
9+
attr() () => {};
10+
() => {};
11+
}
12+
13+
#[macro_export]
14+
macro_rules! macro2 {
15+
attr() () => {};
16+
}
17+
18+
#[macro_export]
19+
macro_rules! macro3 {
20+
() => {};
21+
}

0 commit comments

Comments
 (0)