Update tests

This commit is contained in:
Guillaume Gomez 2021-08-11 20:14:26 +02:00
parent 3aeef67037
commit 0f51652ad3
10 changed files with 81 additions and 31 deletions

View File

@ -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

View File

@ -1,6 +1,6 @@
// exact-check
const QUERY = 'hashmap';
const QUERY = '"hashmap"';
const FILTER_CRATE = 'core';
const EXPECTED = {

View File

@ -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' },
],

View File

@ -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' },
],
};

View File

@ -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' },
],
};

View File

@ -1,6 +1,6 @@
// exact-check
const QUERY = 'true';
const QUERY = '"true"';
const FILTER_CRATE = 'doc_alias_filter';

View File

@ -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
},

View File

@ -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
},

View File

@ -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' },
],
},
];

View File

@ -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 }