Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created June 15, 2011 17:22
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 amalloy/1027587 to your computer and use it in GitHub Desktop.
Save amalloy/1027587 to your computer and use it in GitHub Desktop.
weird clojure.test behavior
;; With this code
(is (every? #{1} (apply-redis-instructions! instrs)))
(is (every? #{1} '(1 1 1)))
;; I get this single failure:
expected: (every? #{1} (apply-redis-instructions! instrs))
actual: (not (every? #{1} (1 1)))
;; With this code, I get no failures
(is (every? #(= % 1) (apply-redis-instructions! instrs)))
(is (every? #(= % 1) '(1 1 1)))
;; Shouldn't #(= % 1) and #{1} be equivalent as predicates for every?
;; and '(1 1 1) should be equivalent to the lazy seq returned by my
;; redis function anyway, no?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment