Permalink
Browse files

Add tests for default values for map lookups.

  • Loading branch information...
1 parent 39be680 commit 00712af26b44124d7971228546b986e4029d1f9d @emezeske emezeske committed with David Nolen Jul 3, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 test/cljs/cljs/core_test.cljs
@@ -16,7 +16,7 @@
(assert (not (= 1 1 2)))
(assert (not (= 1 1 2 1)))
(assert (not (= 1 1 1 2)))
-
+
;; arithmetic
(assert (= (+) 0))
(assert (= (apply + []) 0))
@@ -178,6 +178,11 @@
(assert (= 2 ('b '{:a 1 b 2})))
(assert (= 2 ({:a 1 :b 2} :b)))
(assert (= 2 ({1 1 2 2} 2)))
+ (assert (= 2 (:a {:b 1} 2)))
+ (assert (= 2 (:a {} 2)))
+ (assert (= 2 ({:b 1} :a 2)))
+ (assert (= 2 ({} :a 2)))
+ (assert (= nil (:a {})))
(assert (= 2 (#{1 2 3} 2)))
(assert (= 1 (apply :a '[{:a 1 a 2}])))
@@ -939,7 +944,7 @@
pop
(conj 31)
(conj 32)))))
-
+
(let [stack1 (pop (vec (range 97)))
stack2 (pop stack1)]
(assert (= 95 (peek stack1)))

0 comments on commit 00712af

Please sign in to comment.