Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More thorough test for assoc/update record

  • Loading branch information...
commit 9e6ae80192c0d1602e0dfe13d68bc8287444363c 1 parent ea065d8
@amalloy amalloy authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 test/useful/datatypes_test.clj
View
12 test/useful/datatypes_test.clj
@@ -1,13 +1,13 @@
(ns useful.datatypes-test
(:use clojure.test useful.datatypes))
-(defrecord Test [a b])
+(defrecord Test [a b c])
(record-accessors Test)
(deftest test-record
- (let [init (Test. 1 2)
- second (Test. 1 5)]
- (is (= init (make-record Test :b 2 :a 1)))
- (is (= second (assoc-record init :b 5)))
- (is (= second (update-record init (+ b 3))))
+ (let [init (Test. 1 2 3)
+ second (Test. 1 5 4)]
+ (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)))))
Please sign in to comment.
Something went wrong with that request. Please try again.