Skip to content

Commit 04a1dd1

Browse files
Add regression test for literal search on paths
1 parent bfd5a26 commit 04a1dd1

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

tests/rustdoc-js/literal-path.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// exact-check
2+
3+
// This test ensures that literal search is always applied on elements of the path.
4+
5+
const EXPECTED = [
6+
{
7+
'query': '"some::path"',
8+
'others': [
9+
{ 'path': 'literal_path::some', 'name': 'Path' },
10+
],
11+
},
12+
{
13+
'query': '"somea::path"',
14+
'others': [
15+
{ 'path': 'literal_path::somea', 'name': 'Path' },
16+
],
17+
},
18+
{
19+
'query': '"soma::path"',
20+
'others': [
21+
],
22+
},
23+
];

tests/rustdoc-js/literal-path.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pub mod some {
2+
pub struct Path;
3+
}
4+
5+
pub mod somea {
6+
pub struct Path;
7+
}

0 commit comments

Comments
 (0)