Skip to content
Browse files

Test for metadata.

  • Loading branch information...
1 parent 44f0134 commit 79fea96e7297726a685f4121a197e5ac685b9cfd @abscondment committed May 19, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 test/kdtree/test.clj
View
10 test/kdtree/test.clj
@@ -267,4 +267,12 @@
([80 40]
([60 10] nil ([70 20]))
([90 60]))
- nil))))))
+ nil))))))
+
+(deftest- Retains-Metadata
+ (let [metadata {:arbitrary "Data!"}
+ tree (build-tree [[1 11] [2 5] (with-meta [4 8] metadata) [6 4] [5 0] [7 9] [8 2]])]
+ (is (= (nearest-neighbor tree [3 9])
+ (kdtree/Result. [4.0 8.0] 2.0)))
+ (is (= (meta (nearest-neighbor tree [3 9]))
+ metadata))))

0 comments on commit 79fea96

Please sign in to comment.
Something went wrong with that request. Please try again.