Skip to content

Commit

Permalink
Add basic tests for metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhan0 committed Oct 30, 2019
1 parent 2115bae commit 06a0c00
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/ubergraph/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,13 @@
(testing "Check internal invariants of data structures"
(satisfies-invariants g1)
(satisfies-invariants g2))))

(deftest metadata-test
(let [g1 (graph [1 2])
g2 (with-meta g1 {:a 1})
g3 (vary-meta g2 assoc :b 2)]
(testing "Ubergraphs have metadata"
(is (= (meta g1) {}))
(is (= (meta g2) {:a 1}))
(is (= (meta g3) {:a 1 :b 2}))
(is (= g1 g2 g3)))))

0 comments on commit 06a0c00

Please sign in to comment.