Repository navigation
test(sim): compare every enum-valued read with its catalog literal - #147
Merged
Merged
Conversation
The read set comes from the workshop-rs catalog's value entries with an enum return type. A read in neither the modeled nor the unmodeled table fails the test. Fixes #142
Contributor
Author
|
Verdict: LGTM (head 57cb085) Independent check, not from the PR's own tests.
|
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.
Fixes #142
What
One test,
crates/athena-sim/tests/enum_reads.rs. It lists every catalog value entry whose return type is an enum domain, then runsCompare(<read>, ==, <enum literal>)for each modeled read and asserts true.How the read set is derived
athena-simhas no registry of modeled reads: dispatch ismatch namearms incall.rsandplayer.rs. So the set comes from theworkshop-rscatalog (entries_of(Kind::Value)withreturn_type()in an enum domain; theVectordomain is excluded because its reads yield numeric vectors).A new catalog read in that set fails the test until it is added to
MODELEDorUNMODELED. A new enum-valued read therefore cannot go uncovered, but it needs a one-line table entry, because the call arguments cannot be generated. A read inUNMODELEDmust not complete, so modeling it later fails the test and forces a move toMODELED.Reads covered
Modeled, compared with the literal:
hero,getHero(Hero Of),teamOf,currentMap,getCurrentGamemode,gameMode,workshop setting hero(createWorkshopSettingHero). The scenario usesana,team1,king's row,skirmish, none equal to the member ids.Unmodeled, asserted not to complete:
oppositeTeamOf,getHeroOfDuplication,getControlScoringTeam,eventAbility,customColor.Bug found
None. Every modeled read is true on current
main.Mutation evidence
Changed
"getHero" => player.hero_member.clone()toplayer.hero.clone()inplayer.rs(authored spelling), ran the test, thengit checkout:Verification
cargo test: all passcargo clippy --all-targets -- -D warnings: cleancargo fmt --check: clean