about summary refs log tree commit diff
path: root/tests/rustdoc-js-std
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2024-10-31 13:09:37 -0700
committerMichael Howell <michael@notriddle.com>2024-10-31 13:12:14 -0700
commit9900ea48b566656fb12b5fcbd0a1b20aaa96e5ca (patch)
treecf65459fa0c9ca5b0f79a87f5b372d8fa427f592 /tests/rustdoc-js-std
parent12dc24f46007f82b93ed85614347a42d47580afa (diff)
downloadrust-9900ea48b566656fb12b5fcbd0a1b20aaa96e5ca.tar.gz
rust-9900ea48b566656fb12b5fcbd0a1b20aaa96e5ca.zip
Adjust ranking so that duplicates count against rank
Diffstat (limited to 'tests/rustdoc-js-std')
-rw-r--r--tests/rustdoc-js-std/simd-type-signatures.js20
-rw-r--r--tests/rustdoc-js-std/transmute-fail.js13
-rw-r--r--tests/rustdoc-js-std/transmute.js12
3 files changed, 35 insertions, 10 deletions
diff --git a/tests/rustdoc-js-std/simd-type-signatures.js b/tests/rustdoc-js-std/simd-type-signatures.js
index c07f15dcbe8..4fc14e65ac4 100644
--- a/tests/rustdoc-js-std/simd-type-signatures.js
+++ b/tests/rustdoc-js-std/simd-type-signatures.js
@@ -22,11 +22,6 @@ const EXPECTED = [
             },
             {
                 'path': 'std::simd::prelude::Simd',
-                'name': 'simd_clamp',
-                'href': '../std/simd/prelude/struct.Simd.html#impl-SimdOrd-for-Simd%3Ci16,+N%3E/method.simd_clamp'
-            },
-            {
-                'path': 'std::simd::prelude::Simd',
                 'name': 'saturating_add',
                 'href': '../std/simd/prelude/struct.Simd.html#impl-SimdInt-for-Simd%3Ci16,+N%3E/method.saturating_add'
             },
@@ -35,6 +30,11 @@ const EXPECTED = [
                 'name': 'saturating_sub',
                 'href': '../std/simd/prelude/struct.Simd.html#impl-SimdInt-for-Simd%3Ci16,+N%3E/method.saturating_sub'
             },
+            {
+                'path': 'std::simd::prelude::Simd',
+                'name': 'simd_clamp',
+                'href': '../std/simd/prelude/struct.Simd.html#impl-SimdOrd-for-Simd%3Ci16,+N%3E/method.simd_clamp'
+            },
         ],
     },
     {
@@ -52,11 +52,6 @@ const EXPECTED = [
             },
             {
                 'path': 'std::simd::prelude::Simd',
-                'name': 'simd_clamp',
-                'href': '../std/simd/prelude/struct.Simd.html#impl-SimdOrd-for-Simd%3Ci8,+N%3E/method.simd_clamp'
-            },
-            {
-                'path': 'std::simd::prelude::Simd',
                 'name': 'saturating_add',
                 'href': '../std/simd/prelude/struct.Simd.html#impl-SimdInt-for-Simd%3Ci8,+N%3E/method.saturating_add'
             },
@@ -65,6 +60,11 @@ const EXPECTED = [
                 'name': 'saturating_sub',
                 'href': '../std/simd/prelude/struct.Simd.html#impl-SimdInt-for-Simd%3Ci8,+N%3E/method.saturating_sub'
             },
+            {
+                'path': 'std::simd::prelude::Simd',
+                'name': 'simd_clamp',
+                'href': '../std/simd/prelude/struct.Simd.html#impl-SimdOrd-for-Simd%3Ci8,+N%3E/method.simd_clamp'
+            },
         ],
     },
 ];
diff --git a/tests/rustdoc-js-std/transmute-fail.js b/tests/rustdoc-js-std/transmute-fail.js
new file mode 100644
index 00000000000..c4dddf3cf3c
--- /dev/null
+++ b/tests/rustdoc-js-std/transmute-fail.js
@@ -0,0 +1,13 @@
+// should-fail
+const EXPECTED = [
+    {
+        // Keep this test case identical to `transmute`, except the
+        // should-fail tag and the search query below:
+        'query': 'generic:T -> generic:T',
+        'others': [
+            { 'path': 'std::intrinsics::simd', 'name': 'simd_as' },
+            { 'path': 'std::intrinsics::simd', 'name': 'simd_cast' },
+            { 'path': 'std::intrinsics', 'name': 'transmute' },
+        ],
+    },
+];
diff --git a/tests/rustdoc-js-std/transmute.js b/tests/rustdoc-js-std/transmute.js
new file mode 100644
index 00000000000..0e52e21e0de
--- /dev/null
+++ b/tests/rustdoc-js-std/transmute.js
@@ -0,0 +1,12 @@
+const EXPECTED = [
+    {
+        // Keep this test case identical to `transmute-fail`, except the
+        // should-fail tag and the search query below:
+        'query': 'generic:T -> generic:U',
+        'others': [
+            { 'path': 'std::intrinsics::simd', 'name': 'simd_as' },
+            { 'path': 'std::intrinsics::simd', 'name': 'simd_cast' },
+            { 'path': 'std::intrinsics', 'name': 'transmute' },
+        ],
+    },
+];