Source

clojure-geohash / test / geohash / test / core.clj

Full commit
(ns geohash.test.core
  (:use [geohash.core])
  (:use [clojure.test]))

(deftest test-encode 
  (is (= "ww8p1r4t8" (encode 37.8324 112.5584 9))))

(deftest test-decode
  (let [geodata (decode "ww8p1r4t8")]
    (is (< (Math/abs (- (:lat geodata) 37.8324)) 0.0001))
    (is (< (Math/abs (- (:lon geodata) 112.5584)) 0.0001))))