27: Assert which mistake was reported, not that one was - #41
Open
nikolaystrikhar wants to merge 1 commit into
Open
27: Assert which mistake was reported, not that one was#41nikolaystrikhar wants to merge 1 commit into
nikolaystrikhar wants to merge 1 commit into
Conversation
assert_the_library_reported_incorrect_usage() accepted any report naming this library, so four Loader cases and both Scheduler catch arms passed on a report from an unrelated cause -- and deleting the Config_Exception arm from resolve_conflicts() left the suite green. The trait records the message now and offers an assertion that matches it, so LoaderTest's private copy of that recorder goes away. expect_incorrect_usage() also removes a listener it already installed: run_halted_request() calls it, so two halted requests in one scenario stranded a listener bound to a finished test object on doing_it_wrong_run for the rest of the process. The late-boot fallback is asserted for the conflict step as well as the load, through a should_load filter reading state at the load pass's last gate. A fallback that iterated only the last element of sequence() passed everything.
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.
What:
Tests\Support\Traits\WithIncorrectUsagerecords the reported message and offers an assertion that matches it;LoaderTestandBoot\SchedulerTestuse it, and the late-boot fallback gains an ordering assertion.Usage:
Why this way:
"A report happened" is not an assertion about the cause. Four
Loadercases and bothresolve_conflicts()catch arms passed on a report from anything at all — deleting theConfig_Exceptionarm outright left the suite green.The recorder already existed, privately, in one file. It moves to the trait rather than being copied, since the loose assertion still suits callers that only need it.
expect_incorrect_usage()was leaking listeners.run_halted_request()calls it, so two halted requests in one scenario stranded a listener bound to a finished test object ondoing_it_wrong_runfor the rest of the process.The inline fallback was asserted for the load and not the conflict step, so a fallback iterating only the last element of
sequence()passed everything — the case where losing conflict resolution means both copies load and the request fatals.