Created
August 30, 2012 20:54
-
-
Save puredanger/3540715 to your computer and use it in GitHub Desktop.
tests for sub=
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest test-sub= | |
(are [expected left right] (= expected (sub= left right)) | |
;; prim | |
true 1 1 | |
false 1 2 | |
;; maps | |
true {} {:a 1} | |
false {:a 1} {} | |
true {:a 1} {:a 1} | |
false {:a 1} {:a 2} | |
true {:a 1} {:a 1 :b 2} | |
;; nested maps | |
true {} {:a {:b 1}} | |
false {:a 1} {:b {:c 2}} | |
true {:a {:b 1}} {:a {:b 1}} | |
true {:a {:b 1}} {:a {:b 1 :c 2}} | |
true {:a {}} {:a {:b 1}} | |
false {:a {:b 1}} {:a 1} | |
false {:a {:b 1}} {:a {:b 2}} | |
true {:a {:b 1}} {:a {:b 1 :c 2}})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment