Skip to content
Merged
Changes from 2 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
59d4bae
Add validation for `link` attribute position.
ehuss Jan 9, 2022
b59e743
Mark windows_subsytem and no_builtins as crate-only attributes.
ehuss Jan 9, 2022
012910d
Canonicalize const variables correctly
compiler-errors Jan 7, 2022
9bf9fe0
Don't leak inference variables in array unsizing
compiler-errors Jan 7, 2022
7bf0cb7
Add new tests, fix up old tests
compiler-errors Jan 7, 2022
a7092f9
Typos fix
maxwase Jan 13, 2022
5431d5b
Add rustc_diagnostic_item attribute to AtomicBool
llogiq Jan 13, 2022
c4b994f
Pick themes on settings page, not every page
jsha Jan 6, 2022
04f0402
Add support for "always theme" in setting
jsha Jan 7, 2022
9c6d8ef
htmldocck: Add support for `/text()` in `@snapshot`
camelid Jan 15, 2022
1a37262
Exclude llvm-libunwind from the self-contained set on s390x-musl targ…
kaniini Jan 15, 2022
47de5b4
Remove `collect`
vacuus Jan 15, 2022
e6aef25
Add `~const` bound test for negative impls
lilasta Jan 17, 2022
853feb6
update codegen test for LLVM 14
Jan 17, 2022
e4607ff
update test assertion
Jan 17, 2022
43b9268
Rustdoc style cleanups
jsha Jan 12, 2022
b71f1fb
Hide mobile sidebar on some clicks
jsha Jan 12, 2022
7b5b3cf
Abstract the pretty printer's ringbuffer to be infinitely sized
dtolnay Jan 15, 2022
e012b9a
Stabilize vec_spare_capacity
Amanieu Jan 17, 2022
ae99e23
Add staged_api for tests
jsha Jan 15, 2022
d501ead
Rollup merge of #92629 - jsha:theme-picker-local-only-2, r=GuillaumeG…
matthiaskrgr Jan 18, 2022
cb5ecff
Rollup merge of #92640 - compiler-errors:array-deref-on-newtype, r=lcnr
matthiaskrgr Jan 18, 2022
804072f
Rollup merge of #92701 - ehuss:even-more-attr-validation, r=matthewja…
matthiaskrgr Jan 18, 2022
cc2339c
Rollup merge of #92803 - jsha:hide-sidebar, r=GuillaumeGomez
matthiaskrgr Jan 18, 2022
deee6f7
Rollup merge of #92830 - jsha:style-cleanups, r=GuillaumeGomez
matthiaskrgr Jan 18, 2022
ae8f39e
Rollup merge of #92866 - maxwase:does_exist_typo, r=Mark-Simulacrum
matthiaskrgr Jan 18, 2022
6a5663e
Rollup merge of #92870 - llogiq:atomic_bool_sym, r=Manishearth
matthiaskrgr Jan 18, 2022
be3d25b
Rollup merge of #92914 - camelid:snapshot-text, r=GuillaumeGomez
matthiaskrgr Jan 18, 2022
04b2073
Rollup merge of #92923 - dtolnay:ringbuffer, r=petrochenkov
matthiaskrgr Jan 18, 2022
b05be97
Rollup merge of #92946 - kaniini:chore/llvm-libunwind-s390x, r=Mark-S…
matthiaskrgr Jan 18, 2022
71e5bfe
Rollup merge of #92947 - vacuus:rustdoc-core-visit-path, r=camelid
matthiaskrgr Jan 18, 2022
baeff67
Rollup merge of #92997 - woppopo:test92114, r=Mark-Simulacrum
matthiaskrgr Jan 18, 2022
b8c544d
Rollup merge of #93004 - krasimirgg:threadlocal-llvm-up, r=nikic
matthiaskrgr Jan 18, 2022
83b1a94
Rollup merge of #93016 - Amanieu:vec_spare_capacity, r=Mark-Simulacrum
matthiaskrgr Jan 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/etc/htmldocck.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def get_tree_count(tree, path):
return len(tree.findall(path))


def check_snapshot(snapshot_name, tree):
def check_snapshot(snapshot_name, tree, normalize_to_text):
assert rust_test_path.endswith('.rs')
snapshot_path = '{}.{}.{}'.format(rust_test_path[:-3], snapshot_name, 'html')
try:
Expand All @@ -413,7 +413,10 @@ def check_snapshot(snapshot_name, tree):
else:
raise FailedCheck('No saved snapshot value')

actual_str = ET.tostring(tree).decode('utf-8')
if not normalize_to_text:
actual_str = ET.tostring(tree).decode('utf-8')
else:
actual_str = flatten(tree)

if expected_str != actual_str:
if bless:
Expand Down Expand Up @@ -494,11 +497,16 @@ def check_command(c, cache):
[snapshot_name, html_path, pattern] = c.args
tree = cache.get_tree(html_path)
xpath = normalize_xpath(pattern)
normalize_to_text = False
if xpath.endswith('/text()'):
xpath = xpath[:-7]
normalize_to_text = True

subtrees = tree.findall(xpath)
if len(subtrees) == 1:
[subtree] = subtrees
try:
check_snapshot(snapshot_name, subtree)
check_snapshot(snapshot_name, subtree, normalize_to_text)
ret = True
except FailedCheck as err:
cerr = str(err)
Expand Down