aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/test_clojure/reader.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/clojure/contrib/test_clojure/reader.clj')
-rw-r--r--src/clojure/contrib/test_clojure/reader.clj12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/clojure/contrib/test_clojure/reader.clj b/src/clojure/contrib/test_clojure/reader.clj
index 7351dfb2..cab364d9 100644
--- a/src/clojure/contrib/test_clojure/reader.clj
+++ b/src/clojure/contrib/test_clojure/reader.clj
@@ -59,6 +59,18 @@
(is (instance? Long 9223372036854775807))
(is (instance? Long -9223372036854775808))
+ ;; Numeric constants of different types don't wash out. Regression fixed in
+ ;; r1157. Previously the compiler saw 0 and 0.0 as the same constant and
+ ;; caused the sequence to be built of Doubles.
+ (let [x 0.0]
+ (let [sequence (loop [i 0 l '()]
+ (if (< i 5)
+ (recur (inc i) (conj l i))
+ l))]
+ (is (= [4 3 2 1 0] sequence))
+ (is (every? #(instance? Integer %)
+ sequence))))
+
; Read BigInteger
(is (instance? BigInteger 9223372036854775808))
(is (instance? BigInteger -9223372036854775809))