File: fields.goml

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (50 lines) | stat: -rw-r--r-- 1,484 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// This test checks that fields are displayed as expected (one by line) and they are surrounded
// by margins.

store-value: (margin, "9.6px")
define-function: (
    "check-fields",
    [path, selector_1, selector_2],
    block {
        go-to: "file://" + |DOC_PATH| + "/test_docs/fields/" + |path|
        store-position: (|selector_1|, {"y": a_y})
        store-position: (|selector_2|, {"y": b_y})
        assert: |a_y| < |b_y|

        // Check the margins.
        assert-css: (".structfield.section-header", {
            "margin-top": |margin|,
            "margin-bottom": |margin|,
            "margin-left": "0px",
            "margin-right": "0px",
        }, ALL)
    }
)

call-function: ("check-fields", {
    "path": "struct.Struct.html",
    "selector_1": "#structfield\.a",
    "selector_2": "#structfield\.b",
})

call-function: ("check-fields", {
    "path": "union.Union.html",
    "selector_1": "#structfield\.a",
    "selector_2": "#structfield\.b",
})

go-to: "file://" + |DOC_PATH| + "/test_docs/fields/enum.Enum.html"
store-position: ("#variant\.A\.field\.a", {"y": a_y})
store-position: ("#variant\.A\.field\.b", {"y": b_y})
assert: |a_y| < |b_y|
store-position: ("#variant\.B\.field\.a", {"y": a_y})
store-position: ("#variant\.B\.field\.b", {"y": b_y})
assert: |a_y| < |b_y|

// Check the margins.
assert-css: (".sub-variant-field", {
    "margin-top": |margin|,
    "margin-bottom": |margin|,
    "margin-left": "24px",
    "margin-right": "0px",
}, ALL)