Skip to content

Commit

Permalink
Add test to enforce sidebar trait items order
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 23, 2021
1 parent 5e81325 commit 7245903
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/test/rustdoc-gui/lib.rs
Expand Up @@ -47,14 +47,19 @@ pub fn some_more_function<T: fmt::Debug>(t: &T) -> String {

/// Woohoo! A trait!
pub trait AnotherOne {
/// Some func 3.
fn func3();

/// Some func 1.
fn func1();

fn another();
fn why_not();

/// Some func 2.
fn func2();

/// Some func 3.
fn func3();
fn hello();
}

/// Check for "i" signs in lists!
Expand Down
7 changes: 7 additions & 0 deletions src/test/rustdoc-gui/trait-sidebar-item-order.goml
@@ -0,0 +1,7 @@
goto: file://|DOC_PATH|/trait.AnotherOne.html
assert: (".sidebar-links a:nth-of-type(1)", "another")
assert: (".sidebar-links a:nth-of-type(2)", "func1")
assert: (".sidebar-links a:nth-of-type(3)", "func2")
assert: (".sidebar-links a:nth-of-type(4)", "func3")
assert: (".sidebar-links a:nth-of-type(5)", "hello")
assert: (".sidebar-links a:nth-of-type(6)", "why_not")

0 comments on commit 7245903

Please sign in to comment.