 (deftest test-date
   (is (= {"foo" "1970-01-01T00:00:00Z"}
          (json/decode
-          (json/encode
+          (json/encode*
            {:foo (Date. (long 0))}))))
   (is (= {"foo" "1970-01-01"}
          (json/decode
-          (json/encode
+          (json/encode*
            {:foo (Date. (long 0))} {:date-format "yyyy-MM-dd"})))
       "encode with given date format"))
 
 (deftest test-sql-timestamp
   (is (= {"foo" "1970-01-01T00:00:00Z"}
-         (json/decode (json/encode {:foo (Timestamp. (long 0))}))))
+         (json/decode (json/encode* {:foo (Timestamp. (long 0))}))))
   (is (= {"foo" "1970-01-01"}
-         (json/decode (json/encode {:foo (Timestamp. (long 0))}
-                                   {:date-format "yyyy-MM-dd"})))
+         (json/decode (json/encode* {:foo (Timestamp. (long 0))}
+                                    {:date-format "yyyy-MM-dd"})))
       "encode with given date format"))
 
 (deftest test-uuid
   (let [id (UUID/randomUUID)
         id-str (str id)]
-    (is (= {"foo" id-str} (json/decode (json/encode {:foo id}))))))
+    (is (= {"foo" id-str} (json/decode (json/encode* {:foo id}))))))
 
 (deftest test-streams
   (is (= {"foo" "bar"}


(deftest t-ratio
  (let [n 1/2]
    (is (= (double n) (:num (json/decode (json/encode {:num n}) true))))))

(deftest t-long-wrap-around
  (is (= 2147483648 (json/decode (json/encode 2147483648)))))

(deftest t-bigint
  (let [n 9223372036854775808]
    (is (= n (:num (json/decode (json/encode {:num n}) true))))))

(deftest t-biginteger
  (let [n (BigInteger. "42")]
    (is (= n (:num (json/decode (json/encode {:num n}) true))))))

(deftest t-bigdecimal
  (let [n (BigDecimal. "42.5")]
    (is (= (.doubleValue n) (:num (json/decode (json/encode {:num n}) true))))
    (binding [parse/*use-bigdecimals?* true]
      (is (= n (:num (json/decode (json/encode {:num n}) true)))))))

(deftest test-string-round-trip
  (is (= test-obj (json/decode (json/encode* test-obj)))))

(deftest test-generate-accepts-float
  (is (= "3.14" (json/encode 3.14))))

(deftest test-keyword-encode
  (is (= {"key" "val"}
         (json/decode (json/encode {:key "val"})))))

(deftest test-generate-set
  (is (= {"set" ["a" "b"]}
         (json/decode (json/encode {"set" #{"a" "b"}})))))

(deftest test-key-coercion
  (is (= {"foo" "bar" "1" "bat" "2" "bang" "3" "biz"}

(deftest test-jsondotorg-pass1
  (let [string (slurp "test/pass1.json")
        decoded-json (json/decode string)
        encoded-json (json/encode* decoded-json)
        re-decoded-json (json/decode encoded-json)]
    (is (= decoded-json re-decoded-json))))

