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 Jan 7, 2020
1 parent aa53d03 commit 8f299a0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/ubergraph/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -452,4 +452,14 @@
(remove-attr 1 :keyword)
(remove-attr 1 [:1 :2])
(remove-attr 1 {:k :v})
:attrs))))))
:attrs))))))

(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 8f299a0

Please sign in to comment.