]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/search-tab-change-title-fn-sig.goml
rustdoc: change the "In Function Signatures" to context-sensitive
[rust.git] / src / test / rustdoc-gui / search-tab-change-title-fn-sig.goml
1 // Checks that the search tab results work correctly with function signature syntax
2 // First, try a search-by-name
3 goto: file://|DOC_PATH|/test_docs/index.html
4 write: (".search-input", "Foo")
5 // Waiting for the search results to appear...
6 wait-for: "#titles"
7 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
8 assert-text: ("#titles > button:nth-of-type(1)", "In Names", STARTS_WITH)
9
10 // Now try search-by-return
11 goto: file://|DOC_PATH|/test_docs/index.html
12 write: (".search-input", "-> String")
13 // Waiting for the search results to appear...
14 wait-for: "#titles"
15 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
16 assert-text: ("#titles > button:nth-of-type(1)", "In Function Return Types", STARTS_WITH)
17
18 // Try with a search-by-return with no results
19 goto: file://|DOC_PATH|/test_docs/index.html
20 write: (".search-input", "-> Something")
21 // Waiting for the search results to appear...
22 wait-for: "#titles"
23 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
24 assert-text: ("#titles > button:nth-of-type(1)", "In Function Return Types", STARTS_WITH)
25
26 // Try with a search-by-parameter
27 goto: file://|DOC_PATH|/test_docs/index.html
28 write: (".search-input", "usize pattern")
29 // Waiting for the search results to appear...
30 wait-for: "#titles"
31 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
32 assert-text: ("#titles > button:nth-of-type(1)", "In Function Parameters", STARTS_WITH)
33
34 // Try with a search-by-parameter-and-return
35 goto: file://|DOC_PATH|/test_docs/index.html
36 write: (".search-input", "pattern -> str")
37 // Waiting for the search results to appear...
38 wait-for: "#titles"
39 assert-attribute: ("#titles > button:nth-of-type(1)", {"class": "selected"})
40 assert-text: ("#titles > button:nth-of-type(1)", "In Function Signatures", STARTS_WITH)