Skip to content

Add negative game tests for all advancements#1161

Merged
rubensworks merged 2 commits intomaster-1.21-ltsfrom
copilot/add-negative-game-tests-advancements
Feb 28, 2026
Merged

Add negative game tests for all advancements#1161
rubensworks merged 2 commits intomaster-1.21-ltsfrom
copilot/add-negative-game-tests-advancements

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

Adds negative game tests for all 12 EvilCraft advancements — tests that perform an action almost matching each advancement criterion but not quite — to guard against false-positive triggers.

Changes

  • assertAdvancementNotDone helper: throws GameTestAssertException if an advancement is unexpectedly granted
  • 12 negative test methods, one per advancement, each exercising a near-miss condition:
Advancement Negative condition
root Pick up minecraft:dirt (not an EvilCraft item)
first_age Add dirt to inventory (not dark_gem)
second_age Craft dark_gem (not blood_extractor)
cannibal Consume flesh_werewolf (not flesh_humanoid)
closure Capture spirit with no entangling player (trigger never fires)
evil_source Add dark_gem to inventory (not origins_of_darkness)
fart Fire inventory_changed (not the fart trigger)
master_distorter Fire distort trigger with 9 entities (requires 10)
player_distorter Fire distort trigger with only zombies (requires a player entity)
player_devastator Necromance a zombie (not a player)
power_crafting Craft dark_gem (not exalted_crafter)
spirit_cooker Craft blood_extractor (not spirit_furnace)

The master_distorter and player_distorter negative tests call TRIGGER_DISTORT.get().test(player, entities) directly rather than going through the mace physics, since releaseUsing with itemInUseCount=0 produces a 102-block AABB that can capture mock players from concurrent test structures.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Feb 28, 2026
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title [WIP] Add negative game tests for all advancements Add negative game tests for all advancements Feb 28, 2026
@coveralls
Copy link

Pull Request Test Coverage Report for Build 22525617793

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.4%) to 27.575%

Files with Coverage Reduction New Missed Lines %
org/cyclops/evilcraft/gametest/GameTestsAdvancements.java 1 91.13%
Totals Coverage Status
Change from base Build 22521066550: 0.4%
Covered Lines: 4861
Relevant Lines: 14997

💛 - Coveralls

@rubensworks rubensworks marked this pull request as ready for review February 28, 2026 17:56
@rubensworks rubensworks merged commit 3ef7591 into master-1.21-lts Feb 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants