Repository navigation
fix(rune-kit): require path separator boundary in kit_metrics descendant lookups - #2220
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause
In
crates/rune-kit/tests/integration/kit_metrics.rs(added in #2172,d1534ad13), both failing assertions were bugs in the test's descendant-lookup helpers (underandinput), not in theKit::metricsproduction code:under("field", "input")checkede.path.starts_with(path)wherepath = "#0/field". Because#0/field-defaultprecedes#0/fieldinels,"#0/field-default/value/input".starts_with("#0/field")matchedfield-default's input (x = 8.0) instead offield's input (x = 11.0).input("area")checkede.path.starts_with("#0/area"), which matched#0/area-default/input(x = 8.0, y = 8.0) instead of#0/area/input(x = 12.0, y = 92.0), producing(8.0 - 0.0, 8.0 - 80.0) = (8.0, -72.0)instead of(12.0, 12.0).Default check with
Kit::metricsunset: every default incrates/rune-kit/src/tokens/metrics.rsmatches the pre-#2172 hardcoded values identically, all 51 accessibility golden tests pass unchanged, andkit-gallery::every_story_buildspasses.Fix
Require a
/segment boundary (e.path.strip_prefix(path.as_str()).is_some_and(|rest| rest.starts_with('/'))) inunderandinputincrates/rune-kit/tests/integration/kit_metrics.rs.Verification
4f8a7d140, before unrelated#2206brokeTextSpecsize ondev): entirerune-kittest suite with--features markdown,mermaidpassed (237 lib + 51 a11y + 308 integration + 105 markdown + 16 mermaid + 170 doctests = 887 passed; 0 failed),cargo test -p kit-gallery every_story_builds(1 passed),cargo clippy -p rune-kit --features markdown,mermaid --lib --bins --tests(exit 0),scripts/file-size.sh(0 errors).devby unrelated38f8dc54c(feat(selection): El::selection_enabled(bool), a subtree or window switch for selectable text #2206) failingconst _: () = assert!(std::mem::size_of::<TextSpec>() == 224)incrates/rune/src/el/text_spec.rs:196; this PR changes only pure platform-independent test code inkit_metrics.rs.