about summary refs log tree commit diff
path: root/src/test/rustdoc-js
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-06-15 23:39:20 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2018-06-16 00:13:28 +0200
commit1fcce48451b5d4484d29ddf0641d2228ba78fdbd (patch)
tree5e70b31cd72b23c95dca20efa5194889c8ad8daf /src/test/rustdoc-js
parente28502edcadbf9ab6102493e8774f1af32df4eb9 (diff)
downloadrust-1fcce48451b5d4484d29ddf0641d2228ba78fdbd.tar.gz
rust-1fcce48451b5d4484d29ddf0641d2228ba78fdbd.zip
Add rustdoc-js tester should-fail option
Diffstat (limited to 'src/test/rustdoc-js')
-rw-r--r--src/test/rustdoc-js/keyword.js20
-rw-r--r--src/test/rustdoc-js/should-fail.js19
2 files changed, 39 insertions, 0 deletions
diff --git a/src/test/rustdoc-js/keyword.js b/src/test/rustdoc-js/keyword.js
new file mode 100644
index 00000000000..65de3a4662f
--- /dev/null
+++ b/src/test/rustdoc-js/keyword.js
@@ -0,0 +1,20 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// ignore-order
+
+const QUERY = 'fn';
+
+const EXPECTED = {
+    'others': [
+        { 'path': 'std', 'name': 'fn', ty: 15 }, // 15 is for primitive types
+        { 'path': 'std', 'name': 'fn', ty: 21 }, // 21 is for keywords
+    ],
+};
diff --git a/src/test/rustdoc-js/should-fail.js b/src/test/rustdoc-js/should-fail.js
new file mode 100644
index 00000000000..5e41422612a
--- /dev/null
+++ b/src/test/rustdoc-js/should-fail.js
@@ -0,0 +1,19 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// should-fail
+
+const QUERY = 'fn';
+
+const EXPECTED = {
+    'others': [
+        { 'path': 'std', 'name': 'fn', ty: 14 },
+    ],
+};