Repository navigation
Improve the Syntax Element Assert Helpers - #484
Merged
alexanderlinne merged 2 commits intoAug 28, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #484 +/- ##
=======================================
Coverage 82.50% 82.50%
=======================================
Files 259 259
Lines 12395 12395
Branches 1206 1206
=======================================
Hits 10226 10226
Misses 1798 1798
Partials 371 371 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Evaluation results come out in Mono.Cecil loader order, which is deterministic per build but not stable across Cecil or runtime upgrades. Sort the results ordinally when rendering a snapshot so every "Multiple inputs" and "Multiple arguments" block stops depending on that order. The sorted list is also what is handed to ToErrorMessage, so the "Message:" section is stable too; ToErrorMessage itself is production output and stays untouched. Materialize the evaluation results once in each Assert* method. FormatSnapshot enumerates its argument twice and the All/Any guards add one or two more, so each assertion evaluated its rule up to four times. That is harmless only because every call site currently passes a plain ArchRule, whose Evaluate materializes internally; CombinedArchRule.Evaluate returns a lazy Concat. AssertOnlyViolations could pass vacuously: ArchRule.Evaluate injects a synthetic failing result when a rule produces no results at all, and the assertion only rejected passing results. A helper lookup that stopped matching would therefore keep the test green. Reject that placeholder unless allowNoResults is set. Only one call site legitimately needs it. Signed-off-by: Alexander Linne <alexander.linne@tngtech.com>
alexanderlinne
force-pushed
the
improve-fluent-syntex-elements-test-assert-helpers
branch
from
August 28, 2026 07:30
84e64b5 to
fed9ded
Compare
alexanderlinne
enabled auto-merge
August 28, 2026 08:06
mak638
approved these changes
Aug 28, 2026
alexanderlinne
deleted the
improve-fluent-syntex-elements-test-assert-helpers
branch
August 28, 2026 08:07
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.
Evaluation results come out in Mono.Cecil loader order, which is deterministic per build but not stable across Cecil or runtime upgrades. Sort the results ordinally when rendering a snapshot so every "Multiple inputs" and "Multiple arguments" block stops depending on that order. The sorted list is also what is handed to ToErrorMessage, so the "Message:" section is stable too; ToErrorMessage itself is production output and stays untouched.
Materialize the evaluation results once in each Assert* method. FormatSnapshot enumerates its argument twice and the All/Any guards add one or two more, so each assertion evaluated its rule up to four times. That is harmless only because every call site currently passes a plain ArchRule, whose Evaluate materializes internally; CombinedArchRule.Evaluate returns a lazy Concat.
AssertOnlyViolations could pass vacuously: ArchRule.Evaluate injects a synthetic failing result when a rule produces no results at all, and the assertion only rejected passing results. A helper lookup that stopped matching would therefore keep the test green. Reject that placeholder unless allowNoResults is set. Only one call site legitimately needs it.