diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-inventory.lisp | 8 | ||||
| -rw-r--r-- | tests/test-player.lisp | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/test-inventory.lisp b/tests/test-inventory.lisp index ab732f5..61bfd19 100644 --- a/tests/test-inventory.lisp +++ b/tests/test-inventory.lisp @@ -20,7 +20,7 @@ (test inventory-init-values (let ((i (inventory:new-inventory 100))) (is (= (inventory::size i) 100)) - (is (= (inventory:filled i) 0)) + (is (= (car (inventory:how-filled i)) 0)) (is (eq (inventory::items i) nil)))) ;; test add and substract @@ -30,18 +30,18 @@ (c2 (commodities:new-commodity "apple" 99))) ;; add 10 (is (= (inventory:add-item i c 10) 10)) - (is (= (inventory:filled i) 10)) + (is (= (car (inventory:how-filled i)) 10)) ;; remove 4 (is (equal (inventory:remove-item i "apple" 4) (cons c 4))) - (is (= (inventory:filled i) 6)) + (is (= (car (inventory:how-filled i)) 6)) (is (equal (inventory::find-item i "apple") (cons c 6))) ;; adding 90 (is (= (inventory:add-item i c 90) 96)) ;; adding one too many (is (not (inventory:add-item i c 5))) - (is (= (inventory::filled i) 96)) + (is (= (car (inventory:how-filled i)) 96)) (is (and (commodities:commodity-eq c diff --git a/tests/test-player.lisp b/tests/test-player.lisp index a74ecd7..82cabcf 100644 --- a/tests/test-player.lisp +++ b/tests/test-player.lisp @@ -34,11 +34,11 @@ (is (= 1950 (player:get-cash p))) (is (not (player:buy-item p truck 1))) (is (= 10 - (inventory:filled (player::stock p)))) + (car (inventory:how-filled (player::stock p))))) (is (player:buy-item p c2 10)) (is (= 1840 (player:get-cash p))) (is (= 20 - (inventory:filled (player::stock p)))))) + (car (inventory:how-filled (player::stock p))))))) (test sell-item (let ((p (player:init-player "Joze")) |
