about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-09-05 22:47:23 +0200
committerGitHub <noreply@github.com>2025-09-05 22:47:23 +0200
commit56d99b1a7ceda01be770b765ff2d1b40b193d713 (patch)
tree0e105705dbf8ab191dbaa54d1ea4b184c6e2875d
parent910d6be9a4d060ff1e9b57b26e5705bc46d52dce (diff)
parentb6f8824315367f73e43efe08f6e5a88cc3f117ce (diff)
downloadrust-56d99b1a7ceda01be770b765ff2d1b40b193d713.tar.gz
rust-56d99b1a7ceda01be770b765ff2d1b40b193d713.zip
Rollup merge of #146242 - GuillaumeGomez:rustdoc-gui-scrape, r=lolbinarycat
Ensure that `--html-after-content` option is used to check `scrape_examples_ice` rustdoc GUI test

Follow-up of https://github.com/rust-lang/rust/pull/146091.

This test ensures that the spans are correctly handled when a "local source file" is not the first in the file list. To ensure it's actually what's tested, this test checks that the option is actually used by adding an element.

r? `@lolbinarycat`
-rw-r--r--tests/rustdoc-gui/scrape-examples-ice-links.goml2
-rw-r--r--tests/rustdoc-gui/src/scrape_examples_ice/empty.html1
-rw-r--r--tests/rustdoc-gui/src/scrape_examples_ice/extra.html1
-rw-r--r--tests/rustdoc-gui/src/scrape_examples_ice/src/lib.rs2
4 files changed, 4 insertions, 2 deletions
diff --git a/tests/rustdoc-gui/scrape-examples-ice-links.goml b/tests/rustdoc-gui/scrape-examples-ice-links.goml
index 1db220e1a32..0a159621935 100644
--- a/tests/rustdoc-gui/scrape-examples-ice-links.goml
+++ b/tests/rustdoc-gui/scrape-examples-ice-links.goml
@@ -4,3 +4,5 @@ wait-for: ".scraped-example-title"
 assert-attribute: (".scraped-example-title a", {"href": "../src/bar/bar.rs.html#2"})
 click: ".scraped-example-title a"
 wait-for-property: ("h1", {"innerText": "bar/\nbar.rs"})
+// Ensure that the `--html-after-content` option was correctly handled.
+assert: "#outer-html"
diff --git a/tests/rustdoc-gui/src/scrape_examples_ice/empty.html b/tests/rustdoc-gui/src/scrape_examples_ice/empty.html
deleted file mode 100644
index 8b137891791..00000000000
--- a/tests/rustdoc-gui/src/scrape_examples_ice/empty.html
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/tests/rustdoc-gui/src/scrape_examples_ice/extra.html b/tests/rustdoc-gui/src/scrape_examples_ice/extra.html
new file mode 100644
index 00000000000..e7a420154a6
--- /dev/null
+++ b/tests/rustdoc-gui/src/scrape_examples_ice/extra.html
@@ -0,0 +1 @@
+<span id="outer-html"></span>
diff --git a/tests/rustdoc-gui/src/scrape_examples_ice/src/lib.rs b/tests/rustdoc-gui/src/scrape_examples_ice/src/lib.rs
index b854c7722c9..7d910c6de7d 100644
--- a/tests/rustdoc-gui/src/scrape_examples_ice/src/lib.rs
+++ b/tests/rustdoc-gui/src/scrape_examples_ice/src/lib.rs
@@ -1,5 +1,5 @@
 //@ run-flags:-Zrustdoc-scrape-examples
-//@ compile-flags: --html-after-content empty.html
+//@ compile-flags: --html-after-content extra.html
 pub struct ObscurelyNamedType1;
 
 impl ObscurelyNamedType1 {