Skip to content

Commit 55296c4

Browse files
authored
Rollup merge of #99766 - fmease:htmldocck-subst-channel-when-blessing, r=Mark-Simulacrum
Htmldocck: Substitute the doc channel when blessing Since #84942, the snippet `{{channel}}` gets substituted with the concrete “doc channel” (e.g. `https://doc.rust-lang.org/nightly`) when snapshot files are checked against the actual rustdoc output. However, when you `--bless` rustdoc tests, htmldocck just dumps the concrete channel into the snapshot file and you have to manually do a find-and-replace after blessing to uphold what #84942 set out to fix. I admit it's a bit fragile to blindly replace URLs like this but I guess it's not too bad in practice. Feel free to close this PR if you don't think that this is a good idea. `@rustbot` label T-rustdoc A-testsuite
2 parents b7beec9 + d411a08 commit 55296c4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/etc/htmldocck.py

+1
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ def check_snapshot(snapshot_name, actual_tree, normalize_to_text):
440440

441441
if bless:
442442
with open(snapshot_path, 'w') as snapshot_file:
443+
actual_str = actual_str.replace(channel, "{{channel}}")
443444
snapshot_file.write(actual_str)
444445
else:
445446
print('--- expected ---\n')

0 commit comments

Comments
 (0)