Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Created June 12, 2013 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PuercoPop/5765844 to your computer and use it in GitHub Desktop.
Save PuercoPop/5765844 to your computer and use it in GitHub Desktop.
Why does the test fail?
(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|)..
;; --------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment