Skip to content

Commit 2fd1229

Browse files
Add tests to ensure the font-weight is the correct one
1 parent 7a5837c commit 2fd1229

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/test/rustdoc-gui/font-weight.goml

+13
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,16 @@ assert-css: ("//*[@class='structfield small-section-header']//a[text()='Alias']"
55
assert-css: ("#method\.a_method > code", {"font-weight": "600"})
66
assert-css: ("#associatedtype\.X > code", {"font-weight": "600"})
77
assert-css: ("#associatedconstant\.Y > code", {"font-weight": "600"})
8+
9+
goto: file://|DOC_PATH|/test_docs/type.SomeType.html
10+
assert-css: (".top-doc .docblock p", {"font-weight": "400"}, ALL)
11+
12+
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
13+
assert-css: (".impl-items .method", {"font-weight": "600"}, ALL)
14+
15+
goto: file://|DOC_PATH|/lib2/trait.Trait.html
16+
assert-count: (".methods .type", 1)
17+
assert-css: (".methods .type", {"font-weight": "600"})
18+
assert-count: (".methods .constant", 1)
19+
assert-css: (".methods .constant", {"font-weight": "600"})
20+
assert-css: (".methods .method", {"font-weight": "600"})

src/test/rustdoc-gui/src/lib2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ impl Foo {
2323
pub trait Trait {
2424
type X;
2525
const Y: u32;
26+
27+
fn foo() {}
2628
}
2729

2830
impl Trait for Foo {

0 commit comments

Comments
 (0)