diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/rustdoc-gui/search-result-color.goml | 2 | ||||
| -rw-r--r-- | src/test/rustdoc-js-std/filter-crate.js | 2 | ||||
| -rw-r--r-- | src/test/rustdoc-js-std/quoted.js | 10 | ||||
| -rw-r--r-- | src/test/rustdoc-js-std/struct-vec.js | 4 | ||||
| -rw-r--r-- | src/test/rustdoc-js-std/typed-query.js | 5 | ||||
| -rw-r--r-- | src/test/rustdoc-js/doc-alias-filter.js | 2 | ||||
| -rw-r--r-- | src/test/rustdoc-js/doc-alias-whitespace.js | 2 | ||||
| -rw-r--r-- | src/test/rustdoc-js/doc-alias.js | 62 | ||||
| -rw-r--r-- | src/test/rustdoc-js/generics.js | 21 | ||||
| -rw-r--r-- | src/test/rustdoc-js/generics.rs | 2 |
10 files changed, 81 insertions, 31 deletions
diff --git a/src/test/rustdoc-gui/search-result-color.goml b/src/test/rustdoc-gui/search-result-color.goml index 901634fe0e6..828c20860a6 100644 --- a/src/test/rustdoc-gui/search-result-color.goml +++ b/src/test/rustdoc-gui/search-result-color.goml @@ -1,5 +1,5 @@ // The goal of this test is to ensure the color of the text is the one expected. -goto: file://|DOC_PATH|/test_docs/index.html?search=coo +goto: file://|DOC_PATH|/test_docs/index.html?search=cook // This is needed so that the text color is computed. show-text: true diff --git a/src/test/rustdoc-js-std/filter-crate.js b/src/test/rustdoc-js-std/filter-crate.js index 2e0330c4497..b47a1fefa41 100644 --- a/src/test/rustdoc-js-std/filter-crate.js +++ b/src/test/rustdoc-js-std/filter-crate.js @@ -1,6 +1,6 @@ // exact-check -const QUERY = 'hashmap'; +const QUERY = '"hashmap"'; const FILTER_CRATE = 'core'; const EXPECTED = { diff --git a/src/test/rustdoc-js-std/quoted.js b/src/test/rustdoc-js-std/quoted.js index 924129f86c8..aec8484a41f 100644 --- a/src/test/rustdoc-js-std/quoted.js +++ b/src/test/rustdoc-js-std/quoted.js @@ -1,4 +1,7 @@ +// ignore-order + const QUERY = '"error"'; +const FILTER_CRATE = 'std'; const EXPECTED = { 'others': [ @@ -6,7 +9,12 @@ const EXPECTED = { { 'path': 'std::fmt', 'name': 'Error' }, { 'path': 'std::io', 'name': 'Error' }, ], - 'in_args': [], + 'in_args': [ + { 'path': 'std::fmt::Error', 'name': 'eq' }, + { 'path': 'std::fmt::Error', 'name': 'cmp' }, + { 'path': 'std::fmt::Error', 'name': 'partial_cmp' }, + + ], 'returned': [ { 'path': 'std::fmt::LowerExp', 'name': 'fmt' }, ], diff --git a/src/test/rustdoc-js-std/struct-vec.js b/src/test/rustdoc-js-std/struct-vec.js index 2c808143bae..29609904b19 100644 --- a/src/test/rustdoc-js-std/struct-vec.js +++ b/src/test/rustdoc-js-std/struct-vec.js @@ -1,8 +1,8 @@ -const QUERY = 'struct:Vec'; +const QUERY = 'struct:VecD'; const EXPECTED = { 'others': [ - { 'path': 'std::vec', 'name': 'Vec' }, { 'path': 'std::collections', 'name': 'VecDeque' }, + { 'path': 'std::vec', 'name': 'Vec' }, ], }; diff --git a/src/test/rustdoc-js-std/typed-query.js b/src/test/rustdoc-js-std/typed-query.js index 3915ee7dc5d..25efbad2695 100644 --- a/src/test/rustdoc-js-std/typed-query.js +++ b/src/test/rustdoc-js-std/typed-query.js @@ -1,6 +1,7 @@ // exact-check const QUERY = 'macro:print'; +const FILTER_CRATE = 'std'; const EXPECTED = { 'others': [ @@ -9,6 +10,8 @@ const EXPECTED = { { 'path': 'std', 'name': 'println' }, { 'path': 'std', 'name': 'eprintln' }, { 'path': 'std::pin', 'name': 'pin' }, - { 'path': 'core::pin', 'name': 'pin' }, + { 'path': 'std::future', 'name': 'join' }, + { 'path': 'std', 'name': 'line' }, + { 'path': 'std', 'name': 'write' }, ], }; diff --git a/src/test/rustdoc-js/doc-alias-filter.js b/src/test/rustdoc-js/doc-alias-filter.js index 4b1e2e29704..e06047ba760 100644 --- a/src/test/rustdoc-js/doc-alias-filter.js +++ b/src/test/rustdoc-js/doc-alias-filter.js @@ -1,6 +1,6 @@ // exact-check -const QUERY = 'true'; +const QUERY = '"true"'; const FILTER_CRATE = 'doc_alias_filter'; diff --git a/src/test/rustdoc-js/doc-alias-whitespace.js b/src/test/rustdoc-js/doc-alias-whitespace.js index c9fc0c4311f..3ee55fe455d 100644 --- a/src/test/rustdoc-js/doc-alias-whitespace.js +++ b/src/test/rustdoc-js/doc-alias-whitespace.js @@ -10,7 +10,7 @@ const EXPECTED = [ { 'path': 'doc_alias_whitespace', 'name': 'Struct', - 'alias': 'Demon Lord', + 'alias': 'demon lord', 'href': '../doc_alias_whitespace/struct.Struct.html', 'is_alias': true }, diff --git a/src/test/rustdoc-js/doc-alias.js b/src/test/rustdoc-js/doc-alias.js index ff188d51458..f450bf97981 100644 --- a/src/test/rustdoc-js/doc-alias.js +++ b/src/test/rustdoc-js/doc-alias.js @@ -27,33 +27,36 @@ const QUERY = [ const EXPECTED = [ { + // StructItem 'others': [ { 'path': 'doc_alias', 'name': 'Struct', - 'alias': 'StructItem', + 'alias': 'structitem', 'href': '../doc_alias/struct.Struct.html', 'is_alias': true }, ], }, { + // StructFieldItem 'others': [ { 'path': 'doc_alias::Struct', 'name': 'field', - 'alias': 'StructFieldItem', + 'alias': 'structfielditem', 'href': '../doc_alias/struct.Struct.html#structfield.field', 'is_alias': true }, ], }, { + // StructMethodItem 'others': [ { 'path': 'doc_alias::Struct', 'name': 'method', - 'alias': 'StructMethodItem', + 'alias': 'structmethoditem', 'href': '../doc_alias/struct.Struct.html#method.method', 'is_alias': true }, @@ -69,139 +72,151 @@ const EXPECTED = [ { 'path': 'doc_alias::Struct', 'name': 'ImplConstItem', - 'alias': 'StructImplConstItem', + 'alias': 'structimplconstitem', 'href': '../doc_alias/struct.Struct.html#associatedconstant.ImplConstItem', 'is_alias': true }, ], }, { + // ImplTraitFunction 'others': [ { 'path': 'doc_alias::Struct', 'name': 'function', - 'alias': 'ImplTraitFunction', + 'alias': 'impltraitfunction', 'href': '../doc_alias/struct.Struct.html#method.function', 'is_alias': true }, ], }, { + // EnumItem 'others': [ { 'path': 'doc_alias', 'name': 'Enum', - 'alias': 'EnumItem', + 'alias': 'enumitem', 'href': '../doc_alias/enum.Enum.html', 'is_alias': true }, ], }, { + // VariantItem 'others': [ { 'path': 'doc_alias::Enum', 'name': 'Variant', - 'alias': 'VariantItem', + 'alias': 'variantitem', 'href': '../doc_alias/enum.Enum.html#variant.Variant', 'is_alias': true }, ], }, { + // EnumMethodItem 'others': [ { 'path': 'doc_alias::Enum', 'name': 'method', - 'alias': 'EnumMethodItem', + 'alias': 'enummethoditem', 'href': '../doc_alias/enum.Enum.html#method.method', 'is_alias': true }, ], }, { + // TypedefItem 'others': [ { 'path': 'doc_alias', 'name': 'Typedef', - 'alias': 'TypedefItem', + 'alias': 'typedefitem', 'href': '../doc_alias/type.Typedef.html', 'is_alias': true }, ], }, { + // TraitItem 'others': [ { 'path': 'doc_alias', 'name': 'Trait', - 'alias': 'TraitItem', + 'alias': 'traititem', 'href': '../doc_alias/trait.Trait.html', 'is_alias': true }, ], }, { + // TraitTypeItem 'others': [ { 'path': 'doc_alias::Trait', 'name': 'Target', - 'alias': 'TraitTypeItem', + 'alias': 'traittypeitem', 'href': '../doc_alias/trait.Trait.html#associatedtype.Target', 'is_alias': true }, ], }, { + // AssociatedConstItem 'others': [ { 'path': 'doc_alias::Trait', 'name': 'AssociatedConst', - 'alias': 'AssociatedConstItem', + 'alias': 'associatedconstitem', 'href': '../doc_alias/trait.Trait.html#associatedconstant.AssociatedConst', 'is_alias': true }, ], }, { + // TraitFunctionItem 'others': [ { 'path': 'doc_alias::Trait', 'name': 'function', - 'alias': 'TraitFunctionItem', + 'alias': 'traitfunctionitem', 'href': '../doc_alias/trait.Trait.html#tymethod.function', 'is_alias': true }, ], }, { + // FunctionItem 'others': [ { 'path': 'doc_alias', 'name': 'function', - 'alias': 'FunctionItem', + 'alias': 'functionitem', 'href': '../doc_alias/fn.function.html', 'is_alias': true }, ], }, { + // ModuleItem 'others': [ { 'path': 'doc_alias', 'name': 'Module', - 'alias': 'ModuleItem', + 'alias': 'moduleitem', 'href': '../doc_alias/Module/index.html', 'is_alias': true }, ], }, { + // ConstItem 'others': [ { 'path': 'doc_alias', 'name': 'Const', - 'alias': 'ConstItem', + 'alias': 'constitem', 'href': '../doc_alias/constant.Const.html', 'is_alias': true }, @@ -212,22 +227,24 @@ const EXPECTED = [ ], }, { + // StaticItem 'others': [ { 'path': 'doc_alias', 'name': 'Static', - 'alias': 'StaticItem', + 'alias': 'staticitem', 'href': '../doc_alias/static.Static.html', 'is_alias': true }, ], }, { + // UnionItem 'others': [ { 'path': 'doc_alias', 'name': 'Union', - 'alias': 'UnionItem', + 'alias': 'unionitem', 'href': '../doc_alias/union.Union.html', 'is_alias': true }, @@ -240,33 +257,36 @@ const EXPECTED = [ ], }, { + // UnionFieldItem 'others': [ { 'path': 'doc_alias::Union', 'name': 'union_item', - 'alias': 'UnionFieldItem', + 'alias': 'unionfielditem', 'href': '../doc_alias/union.Union.html#structfield.union_item', 'is_alias': true }, ], }, { + // UnionMethodItem 'others': [ { 'path': 'doc_alias::Union', 'name': 'method', - 'alias': 'UnionMethodItem', + 'alias': 'unionmethoditem', 'href': '../doc_alias/union.Union.html#method.method', 'is_alias': true }, ], }, { + // MacroItem 'others': [ { 'path': 'doc_alias', 'name': 'Macro', - 'alias': 'MacroItem', + 'alias': 'macroitem', 'href': '../doc_alias/macro.Macro.html', 'is_alias': true }, diff --git a/src/test/rustdoc-js/generics.js b/src/test/rustdoc-js/generics.js index 63a9ad53812..9d5937dafdc 100644 --- a/src/test/rustdoc-js/generics.js +++ b/src/test/rustdoc-js/generics.js @@ -1,16 +1,18 @@ // exact-check const QUERY = [ - '"R<P>"', + '"R"<"P">', '"P"', 'P', - '"ExtraCreditStructMulti<ExtraCreditInnerMulti, ExtraCreditInnerMulti>"', + '"ExtraCreditStructMulti"<"ExtraCreditInnerMulti", "ExtraCreditInnerMulti">', 'TraitCat', 'TraitDog', + 'Result<String>', ]; const EXPECTED = [ { + // "R"<"P"> 'returned': [ { 'path': 'generics', 'name': 'alef' }, ], @@ -19,6 +21,7 @@ const EXPECTED = [ ], }, { + // "P" 'others': [ { 'path': 'generics', 'name': 'P' }, ], @@ -30,6 +33,7 @@ const EXPECTED = [ ], }, { + // P 'returned': [ { 'path': 'generics', 'name': 'alef' }, { 'path': 'generics', 'name': 'bet' }, @@ -40,19 +44,32 @@ const EXPECTED = [ ], }, { + // "ExtraCreditStructMulti"<"ExtraCreditInnerMulti", "ExtraCreditInnerMulti"> 'in_args': [ { 'path': 'generics', 'name': 'extracreditlabhomework' }, ], 'returned': [], }, { + // TraitCat 'in_args': [ { 'path': 'generics', 'name': 'gamma' }, ], }, { + // TraitDog 'in_args': [ { 'path': 'generics', 'name': 'gamma' }, ], }, + { + // Result<String> + 'others': [], + 'returned': [ + { 'path': 'generics', 'name': 'super_soup' }, + ], + 'in_args': [ + { 'path': 'generics', 'name': 'super_soup' }, + ], + }, ]; diff --git a/src/test/rustdoc-js/generics.rs b/src/test/rustdoc-js/generics.rs index 5e11a6d6018..055c51c7ec5 100644 --- a/src/test/rustdoc-js/generics.rs +++ b/src/test/rustdoc-js/generics.rs @@ -24,3 +24,5 @@ pub trait TraitCat {} pub trait TraitDog {} pub fn gamma<T: TraitCat + TraitDog>(t: T) {} + +pub fn super_soup(s: Result<String, i32>) -> Result<String, i32> { s } |
