about summary refs log tree commit diff
path: root/src/test/rustdoc-gui
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-04-30 13:05:40 -0700
committerMichael Howell <michael@notriddle.com>2022-05-05 09:37:29 -0700
commit6c8a2d4715ffc5e8ce8b1aec613c091f0198eaea (patch)
tree936ead8daf56546f012fef23ff31158846274fdc /src/test/rustdoc-gui
parenta7d6768e3b60209d4195c822ea3247482909b604 (diff)
downloadrust-6c8a2d4715ffc5e8ce8b1aec613c091f0198eaea.tar.gz
rust-6c8a2d4715ffc5e8ce8b1aec613c091f0198eaea.zip
rustdoc: when running a function-signature search, tweak the tab bar
Diffstat (limited to 'src/test/rustdoc-gui')
-rw-r--r--src/test/rustdoc-gui/search-tab-change-title-fn-sig.goml32
-rw-r--r--src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml23
2 files changed, 32 insertions, 23 deletions
diff --git a/src/test/rustdoc-gui/search-tab-change-title-fn-sig.goml b/src/test/rustdoc-gui/search-tab-change-title-fn-sig.goml
new file mode 100644
index 00000000000..3269305331b
--- /dev/null
+++ b/src/test/rustdoc-gui/search-tab-change-title-fn-sig.goml
@@ -0,0 +1,32 @@
+// Checks that the search tab results work correctly with function signature syntax
+// First, try a search-by-name
+goto: file://|DOC_PATH|/test_docs/index.html
+write: (".search-input", "Foo")
+// Waiting for the search results to appear...
+wait-for: "#titles"
+assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
+assert-text: ("#titles > button:nth-of-type(1)", "In Names", CONTAINS)
+
+// Now try search-by-return
+goto: file://|DOC_PATH|/test_docs/index.html
+write: (".search-input", "-> String")
+// Waiting for the search results to appear...
+wait-for: "#titles"
+assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
+assert-text: ("#titles > button:nth-of-type(1)", "In Function Signature", CONTAINS)
+
+// Try with a search-by-return with no results
+goto: file://|DOC_PATH|/test_docs/index.html
+write: (".search-input", "-> Something")
+// Waiting for the search results to appear...
+wait-for: "#titles"
+assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
+assert-text: ("#titles > button:nth-of-type(1)", "In Function Signature", CONTAINS)
+
+// Try with a search-by-return with no results
+goto: file://|DOC_PATH|/test_docs/index.html
+write: (".search-input", "usize pattern")
+// Waiting for the search results to appear...
+wait-for: "#titles"
+assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
+assert-text: ("#titles > button:nth-of-type(1)", "In Function Signature", CONTAINS)
diff --git a/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml b/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
deleted file mode 100644
index 52b3ceae7b1..00000000000
--- a/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
+++ /dev/null
@@ -1,23 +0,0 @@
-// Checks that the first non-empty search result tab is selected if the default/currently selected
-// one is empty.
-goto: file://|DOC_PATH|/test_docs/index.html
-write: (".search-input", "Foo")
-// Waiting for the search results to appear...
-wait-for: "#titles"
-assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
-
-// To go back to the original "state"
-goto: file://|DOC_PATH|/test_docs/index.html
-write: (".search-input", "-> String")
-// Waiting for the search results to appear...
-wait-for: "#titles"
-// With this search, only the last tab shouldn't be empty so it should be selected.
-assert-attribute: ("#titles > button:nth-of-type(3)", {"class": "selected"})
-
-// To go back to the original "state"
-goto: file://|DOC_PATH|/test_docs/index.html
-write: (".search-input", "-> Something")
-// Waiting for the search results to appear...
-wait-for: "#titles"
-// With this search, all the tabs are empty so the first one should remain selected.
-assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})