From 7659ef47f03f4e2bbbef65856427add98f898ef5 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 5 Apr 2024 21:38:55 +0200 Subject: Use `include` command to reduce code duplication --- tests/rustdoc-gui/docblock-code-block-line-number.goml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'tests/rustdoc-gui/docblock-code-block-line-number.goml') diff --git a/tests/rustdoc-gui/docblock-code-block-line-number.goml b/tests/rustdoc-gui/docblock-code-block-line-number.goml index cb7bdaab4c8..fc80932caba 100644 --- a/tests/rustdoc-gui/docblock-code-block-line-number.goml +++ b/tests/rustdoc-gui/docblock-code-block-line-number.goml @@ -1,4 +1,5 @@ // Checks that the setting "line numbers" is working as expected. +include: "utils.goml" go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" // Otherwise, we can't check text color @@ -13,14 +14,10 @@ define-function: ( [theme, color], block { // We now set the setting to show the line numbers on code examples. - set-local-storage: { - "rustdoc-theme": |theme|, - "rustdoc-use-system-theme": "false", - "rustdoc-line-numbers": "true" - } - // We reload to make the line numbers appear and change theme. - reload: - // We wait for them to be added into the DOM by the JS... + set-local-storage: {"rustdoc-line-numbers": "true"} + // Page will be reloaded in "switch-theme". + call-function: ("switch-theme", {"theme": |theme|}) + // We wait for the line numbers to be added into the DOM by the JS... wait-for: "pre.example-line-numbers" // If the test didn't fail, it means that it was found! assert-css: ( -- cgit 1.4.1-3-g733a5