@@ -5,6 +5,18 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
55// We check that without this setting, there is no line number displayed.
66assert-false: "pre.example-line-numbers"
77
8+ // All corners should be rounded.
9+ assert-css: (
10+ ".example-wrap .rust",
11+ {
12+ "border-top-left-radius": "6px",
13+ "border-bottom-left-radius": "6px",
14+ "border-top-right-radius": "6px",
15+ "border-bottom-right-radius": "6px",
16+ },
17+ ALL,
18+ )
19+
820// We set the setting to show the line numbers on code examples.
921set-local-storage: {"rustdoc-line-numbers": "true"}
1022reload:
@@ -29,9 +41,21 @@ define-function: (
2941 "margin": "0px",
3042 "padding": "14px 8px",
3143 "text-align": "right",
44+ // There should not be a radius on the right of the line numbers.
45+ "border-top-left-radius": "6px",
46+ "border-bottom-left-radius": "6px",
47+ "border-top-right-radius": "0px",
48+ "border-bottom-right-radius": "0px",
3249 },
3350 ALL,
3451 )
52+ // There should not be a radius on the left of the line numbers.
53+ assert-css: ("pre.example-line-numbers + .rust", {
54+ "border-top-left-radius": "0px",
55+ "border-bottom-left-radius": "0px",
56+ "border-top-right-radius": "6px",
57+ "border-bottom-right-radius": "6px",
58+ })
3559 },
3660)
3761call-function: ("check-colors", {
@@ -64,7 +88,45 @@ wait-for: 100 // wait-for-false does not exist
6488assert-false: "pre.example-line-numbers"
6589assert-local-storage: {"rustdoc-line-numbers": "false" }
6690
91+ // Check that the rounded corners are back.
92+ assert-css: (
93+ ".example-wrap .rust",
94+ {
95+ "border-top-left-radius": "6px",
96+ "border-bottom-left-radius": "6px",
97+ "border-top-right-radius": "6px",
98+ "border-bottom-right-radius": "6px",
99+ },
100+ ALL,
101+ )
102+
67103// Finally, turn it on again.
68104click: "input#line-numbers"
69105wait-for: "pre.example-line-numbers"
70106assert-local-storage: {"rustdoc-line-numbers": "true" }
107+
108+ // Same check with scraped examples line numbers.
109+ go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
110+
111+ assert-css: (
112+ ".scraped-example pre.src-line-numbers",
113+ {
114+ // There should not be a radius on the right of the line numbers.
115+ "border-top-left-radius": "6px",
116+ "border-bottom-left-radius": "6px",
117+ "border-top-right-radius": "0px",
118+ "border-bottom-right-radius": "0px",
119+ },
120+ ALL,
121+ )
122+ assert-css: (
123+ ".scraped-example .rust",
124+ {
125+ // There should not be a radius on the left of the code.
126+ "border-top-left-radius": "0px",
127+ "border-bottom-left-radius": "0px",
128+ "border-top-right-radius": "6px",
129+ "border-bottom-right-radius": "6px",
130+ },
131+ ALL,
132+ )
0 commit comments