Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rejig vs annicam #7840

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Rejig vs annicam #7840

merged 3 commits into from
Oct 29, 2024

Conversation

NBKelly
Copy link
Collaborator

@NBKelly NBKelly commented Oct 24, 2024

Rejigging an aniccam previously wasn't getting a draw. Turns out we just missed out an async and defined it in a weird way to make up for that.

I also changed the is-hand?/is-deck?/is-discard? fn's to be error-wrapped macros using the is' function (this is still black magic to me), so if they're wrong it'll tell us where they're being called rather than where the is-hand?/etc function is.

@NoahTheDuke
Copy link
Collaborator

NoahTheDuke commented Oct 29, 2024

normal is just prints directly from where it's written when there's a failure. is' throws an exception when there's a failure. error-wrapper catches the thrown exception and then prints like normal is, but using the macro's location instead of the function's location. this lets us write normal functions for our helpers and then just use a little macro to expand them into the right calls in the tests. it's not ideal, but clojure.test is a bad test framework so we have to make due.

@NoahTheDuke
Copy link
Collaborator

(i'd love to switch us to my test framework lazytest, but we have like 10k lines of test code and i'm not about to do that shit lol)

@NoahTheDuke NoahTheDuke merged commit 6349c48 into mtgred:master Oct 29, 2024
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.

2 participants