Skip to content

Commit 5e34989

Browse files
scgilardiChouser
authored andcommitted
Test reading of numbers like "1." and "1.e3". Fixes #117
Signed-off-by: Chouser <[email protected]>
1 parent 169290b commit 5e34989

File tree

1 file changed

+94
-1
lines changed

1 file changed

+94
-1
lines changed

test/clojure/test_clojure/reader.clj

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,59 @@
8787
(is (instance? BigInteger -10000000000000000000000000000000000000000000000000))
8888

8989
; Read Double
90+
(is (instance? Double +1.0e+1))
91+
(is (instance? Double +1.e+1))
92+
(is (instance? Double +1e+1))
93+
9094
(is (instance? Double +1.0e1))
95+
(is (instance? Double +1.e1))
96+
(is (instance? Double +1e1))
97+
98+
(is (instance? Double +1.0e-1))
99+
(is (instance? Double +1.e-1))
100+
(is (instance? Double +1e-1))
101+
102+
(is (instance? Double 1.0e+1))
103+
(is (instance? Double 1.e+1))
104+
(is (instance? Double 1e+1))
105+
106+
(is (instance? Double 1.0e1))
107+
(is (instance? Double 1.e1))
108+
(is (instance? Double 1e1))
109+
110+
(is (instance? Double 1.0e-1))
111+
(is (instance? Double 1.e-1))
112+
(is (instance? Double 1e-1))
113+
114+
(is (instance? Double -1.0e+1))
115+
(is (instance? Double -1.e+1))
116+
(is (instance? Double -1e+1))
117+
118+
(is (instance? Double -1.0e1))
119+
(is (instance? Double -1.e1))
120+
(is (instance? Double -1e1))
121+
122+
(is (instance? Double -1.0e-1))
123+
(is (instance? Double -1.e-1))
124+
(is (instance? Double -1e-1))
125+
91126
(is (instance? Double +1.0))
127+
(is (instance? Double +1.))
128+
92129
(is (instance? Double 1.0))
130+
(is (instance? Double 1.))
131+
93132
(is (instance? Double +0.0))
133+
(is (instance? Double +0.))
134+
94135
(is (instance? Double 0.0))
136+
(is (instance? Double 0.))
137+
95138
(is (instance? Double -0.0))
139+
(is (instance? Double -0.))
140+
96141
(is (instance? Double -1.0))
97-
(is (instance? Double -1.0e1))
142+
(is (instance? Double -1.))
98143

99144
; Read BigDecimal
100145
(is (instance? BigDecimal 9223372036854775808M))
@@ -107,12 +152,60 @@
107152
(is (instance? BigDecimal -0M))
108153
(is (instance? BigDecimal -1M))
109154
(is (instance? BigDecimal -2147483648M))
155+
156+
(is (instance? BigDecimal +1.0e+1M))
157+
(is (instance? BigDecimal +1.e+1M))
158+
(is (instance? BigDecimal +1e+1M))
159+
160+
(is (instance? BigDecimal +1.0e1M))
161+
(is (instance? BigDecimal +1.e1M))
162+
(is (instance? BigDecimal +1e1M))
163+
164+
(is (instance? BigDecimal +1.0e-1M))
165+
(is (instance? BigDecimal +1.e-1M))
166+
(is (instance? BigDecimal +1e-1M))
167+
168+
(is (instance? BigDecimal 1.0e+1M))
169+
(is (instance? BigDecimal 1.e+1M))
170+
(is (instance? BigDecimal 1e+1M))
171+
172+
(is (instance? BigDecimal 1.0e1M))
173+
(is (instance? BigDecimal 1.e1M))
174+
(is (instance? BigDecimal 1e1M))
175+
176+
(is (instance? BigDecimal 1.0e-1M))
177+
(is (instance? BigDecimal 1.e-1M))
178+
(is (instance? BigDecimal 1e-1M))
179+
180+
(is (instance? BigDecimal -1.0e+1M))
181+
(is (instance? BigDecimal -1.e+1M))
182+
(is (instance? BigDecimal -1e+1M))
183+
184+
(is (instance? BigDecimal -1.0e1M))
185+
(is (instance? BigDecimal -1.e1M))
186+
(is (instance? BigDecimal -1e1M))
187+
188+
(is (instance? BigDecimal -1.0e-1M))
189+
(is (instance? BigDecimal -1.e-1M))
190+
(is (instance? BigDecimal -1e-1M))
191+
110192
(is (instance? BigDecimal +1.0M))
193+
(is (instance? BigDecimal +1.M))
194+
111195
(is (instance? BigDecimal 1.0M))
196+
(is (instance? BigDecimal 1.M))
197+
112198
(is (instance? BigDecimal +0.0M))
199+
(is (instance? BigDecimal +0.M))
200+
113201
(is (instance? BigDecimal 0.0M))
202+
(is (instance? BigDecimal 0.M))
203+
114204
(is (instance? BigDecimal -0.0M))
205+
(is (instance? BigDecimal -0.M))
206+
115207
(is (instance? BigDecimal -1.0M))
208+
(is (instance? BigDecimal -1.M))
116209
)
117210

118211
;; Characters

0 commit comments

Comments
 (0)