Skip to content

Conversation

balazskristof
Copy link
Contributor

Implements Desert Warfare

It's messy.

@github-actions github-actions bot added the cards label May 15, 2025
@Susucre
Copy link
Contributor

Susucre commented May 15, 2025

I would really appreciate some unit testing when adding such complex custom trigger.
Doesn't need to be exhaustif but some ideas of tests:

  • Sacrifice a Desert
  • Sacrifice a non-Desert
  • Have a Desert be destroyed from the battlefield
  • Discard a Desert
  • Discard a non-Desert
  • Mill some cards, including a few Deserts and at least one non-Desert

@balazskristof
Copy link
Contributor Author

Tests added, checks:

  • token generation
  • sacrifice (both in own and opponents' turn)
  • destroy
  • discard (both turns)
  • cycling (both turns)
  • mill (both turns)
  • "lands are Deserts" effects (in this case with Dune Chanter)

assertTokenCount(playerA, "Sand Warrior Token", 0);

setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();
Copy link
Member

@JayDi85 JayDi85 May 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Multiple executes in one test is outdated style with many limitations and bugs. Use real time waitStack and checkXXX commands to assert your game states in single test. For custom checks you can use runCode command (you can call assertXXX inside runCode too).
  2. Use setStrictMode true before each setStopAt or execute command — it will help to find missing choices (in non strict mode AI make that choices).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants