about summary refs log tree commit diff
path: root/tests/rustdoc-gui
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc-gui')
-rw-r--r--tests/rustdoc-gui/sidebar-foreign-impl-sort.goml15
-rw-r--r--tests/rustdoc-gui/src/test_docs/lib.rs18
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/sidebar-foreign-impl-sort.goml b/tests/rustdoc-gui/sidebar-foreign-impl-sort.goml
new file mode 100644
index 00000000000..f09f0971351
--- /dev/null
+++ b/tests/rustdoc-gui/sidebar-foreign-impl-sort.goml
@@ -0,0 +1,15 @@
+// Checks sidebar resizing close the Settings popover
+go-to: "file://" + |DOC_PATH| + "/test_docs/SidebarSort/trait.Sort.html#foreign-impls"
+
+// Check that the sidebar contains the expected foreign implementations
+assert-text: (".sidebar-elems section ul > li:nth-child(1)", "&'a str")
+assert-text: (".sidebar-elems section ul > li:nth-child(2)", "AtomicBool")
+assert-text: (".sidebar-elems section ul > li:nth-child(3)", "AtomicU8")
+assert-text: (".sidebar-elems section ul > li:nth-child(4)", "AtomicU16")
+assert-text: (".sidebar-elems section ul > li:nth-child(5)", "AtomicU32")
+assert-text: (".sidebar-elems section ul > li:nth-child(6)", "Cell<u8>")
+assert-text: (".sidebar-elems section ul > li:nth-child(7)", "Cell<u16>")
+assert-text: (".sidebar-elems section ul > li:nth-child(8)", "u8")
+assert-text: (".sidebar-elems section ul > li:nth-child(9)", "u16")
+assert-text: (".sidebar-elems section ul > li:nth-child(10)", "u32")
+assert-text: (".sidebar-elems section ul > li:nth-child(11)", "usize")
diff --git a/tests/rustdoc-gui/src/test_docs/lib.rs b/tests/rustdoc-gui/src/test_docs/lib.rs
index 1a9ffbe8898..f9c20ab22b8 100644
--- a/tests/rustdoc-gui/src/test_docs/lib.rs
+++ b/tests/rustdoc-gui/src/test_docs/lib.rs
@@ -713,3 +713,21 @@ pub trait ItemsTrait {
     /// blablala
     fn bar();
 }
+
+pub mod SidebarSort {
+    use std::cell::Cell;
+    use std::sync::atomic::*;
+    pub trait Sort {}
+
+    impl Sort for u32 {}
+    impl Sort for u8 {}
+    impl Sort for u16 {}
+    impl Sort for usize {}
+    impl Sort for AtomicU32 {}
+    impl Sort for AtomicU16 {}
+    impl Sort for AtomicU8 {}
+    impl Sort for AtomicBool {}
+    impl Sort for Cell<u16> {}
+    impl Sort for Cell<u8> {}
+    impl<'a> Sort for &'a str {}
+}