|
| 1 | +// This test checks that comments in item declarations are highlighted. |
| 2 | +go-to: "file://" + |DOC_PATH| + "/test_docs/private/enum.Enum.html" |
| 3 | +show-text: true |
| 4 | + |
| 5 | +define-function: ( |
| 6 | + "check-item-decl-comment", |
| 7 | + (theme, url, comment_color), |
| 8 | + block { |
| 9 | + go-to: |url| |
| 10 | + set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"} |
| 11 | + reload: |
| 12 | + assert-css: (".item-decl .comment", {"color": |comment_color|}, ALL) |
| 13 | + } |
| 14 | +) |
| 15 | + |
| 16 | +define-function: ( |
| 17 | + "check-items-for-theme", |
| 18 | + (theme, comment_color), |
| 19 | + block { |
| 20 | + call-function: ("check-item-decl-comment", { |
| 21 | + "theme": |theme|, |
| 22 | + "url": "file://" + |DOC_PATH| + "/test_docs/private/enum.Enum.html", |
| 23 | + "comment_color": |comment_color|, |
| 24 | + }) |
| 25 | + call-function: ("check-item-decl-comment", { |
| 26 | + "theme": |theme|, |
| 27 | + "url": "file://" + |DOC_PATH| + "/test_docs/private/struct.Struct.html", |
| 28 | + "comment_color": |comment_color|, |
| 29 | + }) |
| 30 | + call-function: ("check-item-decl-comment", { |
| 31 | + "theme": |theme|, |
| 32 | + "url": "file://" + |DOC_PATH| + "/test_docs/private/struct.Tuple.html", |
| 33 | + "comment_color": |comment_color|, |
| 34 | + }) |
| 35 | + call-function: ("check-item-decl-comment", { |
| 36 | + "theme": |theme|, |
| 37 | + "url": "file://" + |DOC_PATH| + "/test_docs/private/union.Union.html", |
| 38 | + "comment_color": |comment_color|, |
| 39 | + }) |
| 40 | + call-function: ("check-item-decl-comment", { |
| 41 | + "theme": |theme|, |
| 42 | + "url": "file://" + |DOC_PATH| + "/proc_macro_test/macro.make_answer.html", |
| 43 | + "comment_color": |comment_color|, |
| 44 | + }) |
| 45 | + call-function: ("check-item-decl-comment", { |
| 46 | + "theme": |theme|, |
| 47 | + "url": "file://" + |DOC_PATH| + "/proc_macro_test/derive.HelperAttr.html", |
| 48 | + "comment_color": |comment_color|, |
| 49 | + }) |
| 50 | + } |
| 51 | +) |
| 52 | + |
| 53 | +call-function: ( |
| 54 | + "check-items-for-theme", |
| 55 | + { |
| 56 | + "theme": "ayu", |
| 57 | + "comment_color": "#788797", |
| 58 | + } |
| 59 | +) |
| 60 | +call-function: ( |
| 61 | + "check-items-for-theme", |
| 62 | + { |
| 63 | + "theme": "dark", |
| 64 | + "comment_color": "#8d8d8b", |
| 65 | + } |
| 66 | +) |
| 67 | +call-function: ( |
| 68 | + "check-items-for-theme", |
| 69 | + { |
| 70 | + "theme": "light", |
| 71 | + "comment_color": "#8e908c", |
| 72 | + } |
| 73 | +) |
0 commit comments