]> git.lizzy.rs Git - rust.git/blobdiff - src/test/rustdoc-gui/sidebar.goml
Auto merge of #84863 - ABouttefeux:libtest, r=m-ou-se
[rust.git] / src / test / rustdoc-gui / sidebar.goml
index 7e6b8a9b965c3486ceca70be29874f120e35278f..388ca120d770ea5dab4f33c5d54255dac3444a4f 100644 (file)
@@ -17,12 +17,14 @@ click: "#structs + table td > a"
 
 // PAGE: struct.Foo.html
 assert: (".sidebar .location", 2)
-// We check that we have the crates list and that the "current" on is still "test_docs".
-assert: (".sidebar-elems > .crate > ul > li > a.current", "test_docs")
-// We now move to the other crate to check if its submodules have the correct sidebar elements too.
+// We check that there is no crate listed outside of the top level.
+assert-false: ".sidebar-elems > .crate"
+// We now go back to the crate page to click on the "lib2" crate link.
+goto: file://|DOC_PATH|/test_docs/index.html
 click: ".sidebar-elems > .crate > ul > li:first-child > a"
 
 // PAGE: lib2/index.html
+goto: file://|DOC_PATH|/lib2/index.html
 assert: (".sidebar > .location", "Crate lib2")
 // We check that we have the crates list and that the "current" on is now "lib2".
 assert: (".sidebar-elems > .crate > ul > li > a.current", "lib2")
@@ -36,12 +38,19 @@ click: "#functions + table td > a"
 // In items containing no items (like functions or constants) and in modules, we have one
 // "location" elements.
 assert: (".sidebar .location", 1)
-// We check that we still have the crates list and that the "current" on is still "lib2".
-assert: (".sidebar-elems > .crate > ul > li > a.current", "lib2")
-goto: ./module/sub_module/sub_sub_module/index.html
+// There is a "<br>" tag between "in" and "lib2", but it doesn't count as a space.
+assert: (".sidebar .sidebar-elems .location", "Other items inlib2")
+// We check that we don't have the crate list.
+assert-false: ".sidebar-elems > .crate"
+
+goto: ./module/index.html
+assert: (".sidebar > .location", "Module module")
+// We check that we don't have the crate list.
+assert-false: ".sidebar-elems > .crate"
 
+goto: ./sub_module/sub_sub_module/index.html
 assert: (".sidebar > .location", "Module sub_sub_module")
-assert: (".sidebar-elems > .crate > ul > li:nth-child(2) > a", "test_docs")
-assert: (".sidebar-elems > .crate > ul > li:nth-child(2) > a", "href", "../../../../test_docs/index.html")
+// We check that we don't have the crate list.
+assert-false: ".sidebar-elems > .crate"
 assert: (".sidebar-elems > .items > ul > li:nth-child(1)", "Functions")
 assert: ("#functions + table td > a", "foo")