Skip to content

Commit 05eda41

Browse files
Add tests for type-based search
1 parent 09160b3 commit 05eda41

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const EXPECTED = {
2+
'query': 'vec::vec -> usize',
3+
'others': [
4+
{ 'path': 'std::vec::Vec', 'name': 'len' },
5+
{ 'path': 'std::vec::Vec', 'name': 'capacity' },
6+
],
7+
};
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// exact-check
2+
3+
const EXPECTED = [
4+
{
5+
'query': 'sac -> usize',
6+
'others': [
7+
{ 'path': 'full_path_function::b::Sac', 'name': 'bar' },
8+
{ 'path': 'full_path_function::b::Sac', 'name': 'len' },
9+
{ 'path': 'full_path_function::sac::Sac', 'name': 'len' },
10+
],
11+
},
12+
{
13+
'query': 'b::sac -> usize',
14+
'others': [
15+
{ 'path': 'full_path_function::b::Sac', 'name': 'bar' },
16+
{ 'path': 'full_path_function::b::Sac', 'name': 'len' },
17+
],
18+
},
19+
{
20+
'query': 'b::sac -> u32',
21+
'others': [
22+
{ 'path': 'full_path_function::b::Sac', 'name': 'bar2' },
23+
],
24+
},
25+
];
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
pub mod sac {
2+
pub struct Sac;
3+
4+
impl Sac {
5+
pub fn len(&self) -> usize { 0 }
6+
}
7+
}
8+
9+
pub mod b {
10+
pub struct Sac;
11+
impl Sac {
12+
pub fn len(&self) -> usize { 0 }
13+
pub fn bar(&self, w: u32) -> usize { 0 }
14+
pub fn bar2(&self, w: u32) -> u32 { 0 }
15+
}
16+
}

0 commit comments

Comments
 (0)