diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-02-24 23:38:46 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-02-24 23:38:46 +0000 |
commit | f4d98ad07d117282300d3d1befdfa4c5ef39a357 (patch) | |
tree | 017bb44ad0e9adf53d145590195e575abe806b98 | |
parent | 02b87cdc9c5e5ad7e5a4618ed8131730911ed3da (diff) | |
download | cantedraw-f4d98ad07d117282300d3d1befdfa4c5ef39a357.tar.gz cantedraw-f4d98ad07d117282300d3d1befdfa4c5ef39a357.tar.bz2 cantedraw-f4d98ad07d117282300d3d1befdfa4c5ef39a357.zip |
Implement test for suit->int and int->suit being complete inverses
-rw-r--r-- | tests/model.lisp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/model.lisp b/tests/model.lisp index dd0884e..4294b26 100644 --- a/tests/model.lisp +++ b/tests/model.lisp @@ -103,3 +103,12 @@ (true (every ($>> (<= 0)) res) "All positive") (is equal (length res) (length (remove-duplicates res)) "Unique mapping"))) +(define-test (model-test "int->suit and suit->int are complete inverses") + :depends-on (suit->int int->suit) + (let ((int-range (list 0 13 26 39 52)) + (suit-range (list :diamonds :clubs :hearts :spades :joker))) + (is equal suit-range + (mapcar ($>> suit->int int->suit) suit-range)) + (is equal int-range + (mapcar ($>> int->suit suit->int) int-range)))) + |