From 5e4657d3f7af84a0507eb341d7c51f6b9215295e Mon Sep 17 00:00:00 2001 From: Stefan Schindler Date: Mon, 16 Aug 2021 20:40:23 +0200 Subject: [PATCH 1/3] Fix double output of the summary line --- src/tools/rustdoc-gui/tester.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tools/rustdoc-gui/tester.js b/src/tools/rustdoc-gui/tester.js index 4e77d27d399c2..d1cf5fb803d63 100644 --- a/src/tools/rustdoc-gui/tester.js +++ b/src/tools/rustdoc-gui/tester.js @@ -93,8 +93,13 @@ function char_printer(n_tests) { } }, finish: function() { - const spaces = " ".repeat(max_per_line - (current % max_per_line)); - process.stdout.write(`${spaces} (${current}/${n_tests})${os.EOL}${os.EOL}`); + if (current % max_per_line === 0) { + // Don't output if we are already at a matching line end + console.log(""); + } else { + const spaces = " ".repeat(max_per_line - (current % max_per_line)); + process.stdout.write(`${spaces} (${current}/${n_tests})${os.EOL}${os.EOL}`); + } }, }; } From ee4521e19b3d3518a3ead06b1bebec77f0955319 Mon Sep 17 00:00:00 2001 From: Stefan Schindler Date: Mon, 16 Aug 2021 20:41:15 +0200 Subject: [PATCH 2/3] Add a font test based on #85669 --- src/test/rustdoc-gui/module-item-font.goml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/test/rustdoc-gui/module-item-font.goml diff --git a/src/test/rustdoc-gui/module-item-font.goml b/src/test/rustdoc-gui/module-item-font.goml new file mode 100644 index 0000000000000..12dbd0195978a --- /dev/null +++ b/src/test/rustdoc-gui/module-item-font.goml @@ -0,0 +1,21 @@ +goto: file://|DOC_PATH|/test_docs/index.html +// This test ensures that the correct font is applied on the modules listed items. + +// modules +assert-css: ("#modules + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#modules + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) +// structs +assert-css: ("#structs + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#structs + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) +// enums +assert-css: ("#enums + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#enums + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) +// traits +assert-css: ("#traits + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#traits + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) +// functions +assert-css: ("#functions + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#functions + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) +// keywords +assert-css: ("#keywords + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#keywords + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) From 2f486d5f8d77256c4bba91b135f62e66fcc85e04 Mon Sep 17 00:00:00 2001 From: Stefan Schindler Date: Mon, 16 Aug 2021 21:38:30 +0200 Subject: [PATCH 3/3] Merge the two test files as they are testing the same features --- src/test/rustdoc-gui/module-item-font.goml | 21 --------------------- src/test/rustdoc-gui/module-items-font.goml | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 21 deletions(-) delete mode 100644 src/test/rustdoc-gui/module-item-font.goml diff --git a/src/test/rustdoc-gui/module-item-font.goml b/src/test/rustdoc-gui/module-item-font.goml deleted file mode 100644 index 12dbd0195978a..0000000000000 --- a/src/test/rustdoc-gui/module-item-font.goml +++ /dev/null @@ -1,21 +0,0 @@ -goto: file://|DOC_PATH|/test_docs/index.html -// This test ensures that the correct font is applied on the modules listed items. - -// modules -assert-css: ("#modules + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) -assert-css: ("#modules + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) -// structs -assert-css: ("#structs + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) -assert-css: ("#structs + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) -// enums -assert-css: ("#enums + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) -assert-css: ("#enums + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) -// traits -assert-css: ("#traits + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) -assert-css: ("#traits + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) -// functions -assert-css: ("#functions + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) -assert-css: ("#functions + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) -// keywords -assert-css: ("#keywords + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) -assert-css: ("#keywords + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) diff --git a/src/test/rustdoc-gui/module-items-font.goml b/src/test/rustdoc-gui/module-items-font.goml index 817b148bee1a6..ab595d2801921 100644 --- a/src/test/rustdoc-gui/module-items-font.goml +++ b/src/test/rustdoc-gui/module-items-font.goml @@ -2,3 +2,22 @@ goto: file://|DOC_PATH|/test_docs/index.html assert-css: (".item-table .module-item a", {"font-family": '"Fira Sans", Arial, sans-serif'}, ALL) assert-css: (".item-table .docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}, ALL) + +// modules +assert-css: ("#modules + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#modules + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) +// structs +assert-css: ("#structs + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#structs + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) +// enums +assert-css: ("#enums + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#enums + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) +// traits +assert-css: ("#traits + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#traits + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) +// functions +assert-css: ("#functions + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#functions + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'}) +// keywords +assert-css: ("#keywords + .item-table .item-left a", {"font-family": '"Fira Sans", Arial, sans-serif'}) +assert-css: ("#keywords + .item-table .item-right.docblock-short", {"font-family": '"Source Serif 4", "Noto Sans KR", serif'})