public
Created

Why does the test fail?

  • Download Gist
test.lisp
Common Lisp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
(in-package :cl-user)
(ql:quickload :fiveam)
 
(defun top-left (board)
(car board))
 
(defun (setf top-left) (value board)
(setf (car board) value))
 
(fiveam:test top-left-accessor ()
(let ((board '(:1 :2 :3 :4 :5 :6 :7 :8 :9))
(expected-board '(:empty :2 :3 :4 :5 :6 :7 :8 :9)))
(setf (top-left board) :empty)
(fiveam:is (equal board expected-board))))
 
(fiveam:run! 'top-left-accessor)
 
;; Result of running this
;; Failure Details:
;; --------------------------------
;; TOP-LEFT-ACCESSOR []:
;; EXPECTED-BOARD evaluated to (:EMPTY :|2| :|3| :|4| :|5| :|6| :|7| :|8| :|9|), which is not EQUAL to (:EMPTY
;; :|2|
;; :|3|
;; :|4|
;; :|5|
;; :|6|
;; :|7|
;; :|8|
;; :|9|)..
;; --------------------------------

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.