Skip to content

Commit

Permalink
Update rustdoc-js* format
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 9, 2023
1 parent 6b0c7c4 commit 9803651
Show file tree
Hide file tree
Showing 67 changed files with 236 additions and 400 deletions.
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/alias-1.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const QUERY = '&';

const EXPECTED = {
'query': '&',
'others': [
{ 'path': 'std', 'name': 'reference' },
],
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/alias-2.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const QUERY = '+';

const EXPECTED = {
'query': '+',
'others': [
{ 'path': 'std::ops', 'name': 'AddAssign' },
{ 'path': 'std::ops', 'name': 'Add' },
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/alias-3.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const QUERY = '!';

const EXPECTED = {
'query': '!',
'others': [
{ 'path': 'std', 'name': 'never' },
],
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/alias-4.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const QUERY = '<';

const EXPECTED = {
'query': '<',
'others': [
{ 'name': 'Ord' },
],
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/alias.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// ignore-order

const QUERY = '[';

const EXPECTED = {
'query': '[',
'others': [
{ 'path': 'std', 'name': 'slice' },
{ 'path': 'std::ops', 'name': 'IndexMut' },
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/asrawfd.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// ignore-order

const QUERY = 'RawFd::as_raw_fd';

const EXPECTED = {
'query': 'RawFd::as_raw_fd',
'others': [
// Reproduction test for https://github.com/rust-lang/rust/issues/78724
// Validate that type alias methods get the correct path.
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/basic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const QUERY = 'String';

const EXPECTED = {
'query': 'String',
'others': [
{ 'path': 'std::string', 'name': 'String' },
{ 'path': 'std::ffi', 'name': 'CString' },
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/deduplication.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// ignore-order

const QUERY = 'is_nan';

const EXPECTED = {
'query': 'is_nan',
'others': [
{ 'path': 'std::f32', 'name': 'is_nan' },
{ 'path': 'std::f64', 'name': 'is_nan' },
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/enum-option.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const QUERY = 'enum:Option';

const EXPECTED = {
'query': 'enum:Option',
'others': [
{ 'path': 'std::option', 'name': 'Option' },
],
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-js-std/filter-crate.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// exact-check

const QUERY = '"hashmap"';
const FILTER_CRATE = 'core';

const EXPECTED = {
'query': 'hashmap',
'others': [
],
};
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/fn-forget.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const QUERY = 'fn:forget';

const EXPECTED = {
'query': 'fn:forget',
'others': [
{ 'path': 'std::mem', 'name': 'forget' },
{ 'path': 'std::fmt', 'name': 'format' },
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/from_u.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const QUERY = 'from_u';

const EXPECTED = {
'query': 'from_u',
'others': [
{ 'path': 'std::char', 'name': 'from_u32' },
{ 'path': 'std::str', 'name': 'from_utf8' },
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/keyword.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// ignore-order

const QUERY = 'fn';

const EXPECTED = {
'query': 'fn',
'others': [
{ 'path': 'std', 'name': 'fn', ty: 15 }, // 15 is for primitive types
{ 'path': 'std', 'name': 'fn', ty: 21 }, // 21 is for keywords
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/macro-check.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// ignore-order

const QUERY = 'panic';

const EXPECTED = {
'query': 'panic',
'others': [
{ 'path': 'std', 'name': 'panic', ty: 14 }, // 15 is for macros
{ 'path': 'std', 'name': 'panic', ty: 0 }, // 0 is for modules
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/macro-print.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const QUERY = 'macro:print';

const EXPECTED = {
'query': 'macro:print',
'others': [
{ 'path': 'std', 'name': 'print' },
{ 'path': 'std', 'name': 'println' },
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc-js-std/never.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const QUERY = '!';

const EXPECTED = {
'query': '!',
'others': [
{ 'path': 'std', 'name': 'never' },
],
Expand Down
7 changes: 2 additions & 5 deletions tests/rustdoc-js-std/option-type-signatures.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
const QUERY = [
'option, fnonce -> option',
'option -> default',
];

const EXPECTED = [
{
'query': 'option, fnonce -> option',
'others': [
{ 'path': 'std::option::Option', 'name': 'map' },
],
},
{
'query': 'option -> default',
'others': [
{ 'path': 'std::option::Option', 'name': 'unwrap_or_default' },
{ 'path': 'std::option::Option', 'name': 'get_or_insert_default' },
Expand Down
Loading

0 comments on commit 9803651

Please sign in to comment.