diff options
Diffstat (limited to 'tests/rustdoc-js-std')
| -rw-r--r-- | tests/rustdoc-js-std/asrawfd.js | 1 | ||||
| -rw-r--r-- | tests/rustdoc-js-std/path-maxeditdistance.js | 42 | ||||
| -rw-r--r-- | tests/rustdoc-js-std/path-ordering.js | 31 |
3 files changed, 62 insertions, 12 deletions
diff --git a/tests/rustdoc-js-std/asrawfd.js b/tests/rustdoc-js-std/asrawfd.js index 5b3cfeabbcd..5dbc4ba95d9 100644 --- a/tests/rustdoc-js-std/asrawfd.js +++ b/tests/rustdoc-js-std/asrawfd.js @@ -7,7 +7,6 @@ const EXPECTED = { // Validate that type alias methods get the correct path. { 'path': 'std::os::fd::AsRawFd', 'name': 'as_raw_fd' }, { 'path': 'std::os::fd::AsRawFd', 'name': 'as_raw_fd' }, - { 'path': 'std::os::linux::process::PidFd', 'name': 'as_raw_fd' }, { 'path': 'std::os::fd::RawFd', 'name': 'as_raw_fd' }, ], }; diff --git a/tests/rustdoc-js-std/path-maxeditdistance.js b/tests/rustdoc-js-std/path-maxeditdistance.js new file mode 100644 index 00000000000..822389aaa4f --- /dev/null +++ b/tests/rustdoc-js-std/path-maxeditdistance.js @@ -0,0 +1,42 @@ +// exact-check +const FILTER_CRATE = "std"; +const EXPECTED = [ + { + query: 'vec::intoiterator', + others: [ + // trait std::iter::IntoIterator is not the first result + { 'path': 'std::vec', 'name': 'IntoIter' }, + { 'path': 'std::vec::Vec', 'name': 'into_iter' }, + { 'path': 'std::vec::Drain', 'name': 'into_iter' }, + { 'path': 'std::vec::IntoIter', 'name': 'into_iter' }, + { 'path': 'std::vec::ExtractIf', 'name': 'into_iter' }, + { 'path': 'std::vec::Splice', 'name': 'into_iter' }, + { 'path': 'std::collections::VecDeque', 'name': 'into_iter' }, + ], + }, + { + query: 'vec::iter', + others: [ + // std::net::ToSocketAttrs::iter should not show up here + { 'path': 'std::vec', 'name': 'IntoIter' }, + { 'path': 'std::vec::Vec', 'name': 'from_iter' }, + { 'path': 'std::vec::Vec', 'name': 'into_iter' }, + { 'path': 'std::vec::Drain', 'name': 'into_iter' }, + { 'path': 'std::vec::IntoIter', 'name': 'into_iter' }, + { 'path': 'std::vec::ExtractIf', 'name': 'into_iter' }, + { 'path': 'std::vec::Splice', 'name': 'into_iter' }, + { 'path': 'std::collections::VecDeque', 'name': 'iter' }, + { 'path': 'std::collections::VecDeque', 'name': 'iter_mut' }, + { 'path': 'std::collections::VecDeque', 'name': 'from_iter' }, + { 'path': 'std::collections::VecDeque', 'name': 'into_iter' }, + ], + }, + { + query: 'slice::itermut', + others: [ + // std::collections::btree_map::itermut should not show up here + { 'path': 'std::slice', 'name': 'IterMut' }, + { 'path': 'std::slice', 'name': 'iter_mut' }, + ], + }, +]; diff --git a/tests/rustdoc-js-std/path-ordering.js b/tests/rustdoc-js-std/path-ordering.js index c3d61d238cc..e6b7bfab1e5 100644 --- a/tests/rustdoc-js-std/path-ordering.js +++ b/tests/rustdoc-js-std/path-ordering.js @@ -1,11 +1,20 @@ -const EXPECTED = { - query: 'hashset::insert', - others: [ - // ensure hashset::insert comes first - { 'path': 'std::collections::hash_set::HashSet', 'name': 'insert' }, - { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert' }, - { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert_with' }, - { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert_owned' }, - { 'path': 'std::collections::hash_map::HashMap', 'name': 'insert' }, - ], -}; +const EXPECTED = [ + { + query: 'hashset::insert', + others: [ + // ensure hashset::insert comes first + { 'path': 'std::collections::hash_set::HashSet', 'name': 'insert' }, + { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert' }, + { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert_with' }, + { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert_owned' }, + ], + }, + { + query: 'hash::insert', + others: [ + // ensure hashset/hashmap::insert come first + { 'path': 'std::collections::hash_map::HashMap', 'name': 'insert' }, + { 'path': 'std::collections::hash_set::HashSet', 'name': 'insert' }, + ], + }, +]; |
