Permalink
Browse files

Write test case to check if issue #148 is still relevant. Turns out i…

…t is...
  • Loading branch information...
Johan Heander
Johan Heander committed May 2, 2018
1 parent 381b61c commit 47d9850004ab63aaee04a412317c4e779ba34883
Showing with 16 additions and 1 deletion.
  1. +1 −1 project.clj
  2. +15 −0 test/somnium/test/congomongo.clj
View
@@ -10,7 +10,7 @@
:distribution :repo}
:min-lein-version "2.0.0"
:dependencies [[org.clojure/data.json "0.2.6"]
- [org.mongodb/mongo-java-driver "2.14.2"]
+ [org.mongodb/mongo-java-driver "2.14.3"]
[org.clojure/clojure "1.9.0" :scope "provided"]]
;; if a :dev profile is added, remember to update :aliases below to
;; use it in each with-profile group!
@@ -169,6 +169,21 @@
(is (= #{1 2 3} (set (:num-set (fetch-one :test_col)))))
(is (= #{"key1" "key2"} (set (:kw-set (fetch-one :test_col)))))))
+;; TODO Uncomment this test after upgrading java driver, see issue #148
+; (deftest can-insert-bigdecimal
+; (let [numbers [(BigDecimal. 123)
+; (BigDecimal. "12345678901234567890")
+; (BigDecimal. (long 42))
+; (BigDecimal. "42.0")
+; (BigDecimal. (double 42))
+; (BigDecimal. "1.2345678901234567890")
+; (BigDecimal. Long/MAX_VALUE)
+; (BigDecimal. Long/MIN_VALUE)
+; (BigDecimal. 0)]]
+; (with-test-mongo
+; (insert! :test_col {:_id "can-insert-bigdecimal" :numbers numbers})
+; (is (= numbers (:numbers (fetch-one :test_col :where {:_id "can-insert-bigdecimal"})))))))
+
(deftest collection-existence
(with-test-mongo
(insert! :notbogus {:foo "bar"})

0 comments on commit 47d9850

Please sign in to comment.