Permalink
Browse files

More tests for assoc-record

  • Loading branch information...
amalloy committed Nov 2, 2011
1 parent 9e6ae80 commit 54a8ed4ad43d968210b06e404763c1222096f03c
Showing with 7 additions and 1 deletion.
  1. +7 −1 test/useful/datatypes_test.clj
@@ -10,4 +10,10 @@
(is (= init (make-record Test :b 2 :a 1 :c 3)))
(is (= second (assoc-record init :b 5 :c 4)))
(is (= second (update-record init (+ b 3) (inc c))))
- (is (= (:a init) (a init)))))
+ (is (= (:a init) (a init)))
+ (testing "Preserves metadata"
+ (let [m {:test 1}
+ r (Test. 1 2 3 m {})]
+ (is (= m (meta (assoc-record r :b 10))))))
+ (testing "Inline typehinting"
+ (is (= second (assoc-record ^Test (assoc init :b 5) :c 4))))))

0 comments on commit 54a8ed4

Please sign in to comment.