Add tests for type-based search
This commit is contained in:
parent
09160b3f45
commit
05eda41658
7
tests/rustdoc-js-std/full-path-function.js
Normal file
7
tests/rustdoc-js-std/full-path-function.js
Normal file
@ -0,0 +1,7 @@
|
||||
const EXPECTED = {
|
||||
'query': 'vec::vec -> usize',
|
||||
'others': [
|
||||
{ 'path': 'std::vec::Vec', 'name': 'len' },
|
||||
{ 'path': 'std::vec::Vec', 'name': 'capacity' },
|
||||
],
|
||||
};
|
25
tests/rustdoc-js/full-path-function.js
Normal file
25
tests/rustdoc-js/full-path-function.js
Normal file
@ -0,0 +1,25 @@
|
||||
// exact-check
|
||||
|
||||
const EXPECTED = [
|
||||
{
|
||||
'query': 'sac -> usize',
|
||||
'others': [
|
||||
{ 'path': 'full_path_function::b::Sac', 'name': 'bar' },
|
||||
{ 'path': 'full_path_function::b::Sac', 'name': 'len' },
|
||||
{ 'path': 'full_path_function::sac::Sac', 'name': 'len' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'b::sac -> usize',
|
||||
'others': [
|
||||
{ 'path': 'full_path_function::b::Sac', 'name': 'bar' },
|
||||
{ 'path': 'full_path_function::b::Sac', 'name': 'len' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'b::sac -> u32',
|
||||
'others': [
|
||||
{ 'path': 'full_path_function::b::Sac', 'name': 'bar2' },
|
||||
],
|
||||
},
|
||||
];
|
16
tests/rustdoc-js/full-path-function.rs
Normal file
16
tests/rustdoc-js/full-path-function.rs
Normal file
@ -0,0 +1,16 @@
|
||||
pub mod sac {
|
||||
pub struct Sac;
|
||||
|
||||
impl Sac {
|
||||
pub fn len(&self) -> usize { 0 }
|
||||
}
|
||||
}
|
||||
|
||||
pub mod b {
|
||||
pub struct Sac;
|
||||
impl Sac {
|
||||
pub fn len(&self) -> usize { 0 }
|
||||
pub fn bar(&self, w: u32) -> usize { 0 }
|
||||
pub fn bar2(&self, w: u32) -> u32 { 0 }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user