Repository navigation
test(explain): cover scalar inner-loop summaries - #990
Merged
Anand Krishnamoorthi (anakrish) merged 1 commit intoNov 24, 2026
Merged
Anand Krishnamoorthi (anakrish) merged 1 commit into
Anand Krishnamoorthi (anakrish) merged 1 commit into
Conversation
Clarify that skipped iteration bodies do not preclude guarded loop-level checks. Cover number, string and null inputs for some and indexed loops in every, retaining silent ordinary-loop controls in both VM execution modes. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The tests can pass despite unexpected body-check events or incorrect provenance because they filter events and do not verify exact source coordinates.
2 open issues
What changed in this PR
Extends regression coverage for scalar loop inputs in RVM explanations and clarifies the documented behavior. No runtime, public API, or serialization changes are introduced.
Changes:
- Add number, string, and null cases for
someand indexed loops insideevery, exercised in both VM execution modes. - Add scalar controls for ordinary loops that must not emit loop-level
Iterationchecks. - Clarify that skipped iteration bodies can still produce guarded loop-level checks.
| File | Description |
|---|---|
tests/rvm/explain_hooks.rs |
Adds scalar inputs to inner-loop summary tests and ordinary-loop controls. |
src/explain/recorder.rs |
Clarifies the distinction between iteration-body checks and loop-level checks. |
Review effort: Max
Comment on lines
+1231
to
+1233
| ("42", Failure, Value::Undefined), | ||
| (r#""text""#, Failure, Value::Undefined), | ||
| ("null", Failure, Value::Undefined), |
Comment on lines
+1231
to
+1233
| ("42", Failure, Value::Undefined), | ||
| (r#""text""#, Failure, Value::Undefined), | ||
| ("null", Failure, Value::Undefined), |
Anand Krishnamoorthi (anakrish)
approved these changes
Nov 24, 2026
Anand Krishnamoorthi (anakrish)
merged commit Nov 24, 2026
43461b5
into
microsoft:main
61 checks passed
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.

Summary
Clarify that an empty or non-collection loop input skips iteration body checks but can still produce a guarded loop-level
Iterationcheck.Extend the existing inner-loop tests with number, string and null inputs for both
someand indexed loops insideevery. Assert exactly one inner failure followed by the enclosingeveryfailure, with the expected collection and source location, in both VM execution modes. Ordinary-loop controls emit no loop-levelIterationchecks.Compatibility
No runtime, public API or serialization changes.
Related
Follows #968.
Testing
cargo +1.95.0 fmt --all -- --check.cargo +1.95.0 clippy --all-features --all-targets -- -D warnings.cargo +1.95.0 clippy --no-default-features -- -D warnings.cargo +1.95.0 test --doc --features explanations.