Skip to content

Commit bd81949

Browse files
Add test for implementors
1 parent da6d82e commit bd81949

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// The goal of this test is to check that the external trait implementors, generated with JS,
2+
// have the same display than the "local" ones.
3+
goto: file://|DOC_PATH|/implementors/trait.Whatever.html
4+
assert: "#implementors-list"
5+
// There are supposed to be two implementors listed.
6+
assert-count: ("#implementors-list > .impl", 2)
7+
// Now we check that both implementors have an anchor, an ID and a similar DOM.
8+
assert: ("#implementors-list > .impl:nth-child(1) > a.anchor")
9+
assert-attribute: ("#implementors-list > .impl:nth-child(1)", {"id": "impl-Whatever"})
10+
assert-attribute: ("#implementors-list > .impl:nth-child(1) > a.anchor", {"href": "#impl-Whatever"})
11+
assert: "#implementors-list > .impl:nth-child(1) > code.in-band"
12+
13+
assert: ("#implementors-list > .impl:nth-child(2) > a.anchor")
14+
assert-attribute: ("#implementors-list > .impl:nth-child(2)", {"id": "impl-Whatever-1"})
15+
assert-attribute: ("#implementors-list > .impl:nth-child(2) > a.anchor", {"href": "#impl-Whatever-1"})
16+
assert: "#implementors-list > .impl:nth-child(2) > code.in-band"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "implementors"
3+
version = "0.1.0"
4+
edition = "2018"
5+
6+
[lib]
7+
path = "lib.rs"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pub trait Whatever {
2+
fn method() {}
3+
}
4+
5+
pub struct Struct;
6+
7+
impl Whatever for Struct {}

0 commit comments

Comments
 (0)