Skip to content

Commit a3eb1b6

Browse files
authored
Skip system-dependent number tests (#80)
Signed-off-by: James Hamlin <jfhamlin@gmail.com>
1 parent d954d25 commit a3eb1b6

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

test/glojure/test_glojure/numbers.glj

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,21 @@
142142
[
143143
[:input [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 math.MaxInt64 math.MaxFloat32 math.MaxFloat64]]
144144
[char [:error (char 0) (char 1) (char 127) (char 32767) :error :error :error :error]]
145-
;; In go, char == rune, which is equivalent to int32
146-
[unchecked-char [(Char -1) (Char 0) (Char 1) (Char 127) (Char 32767) (Char math.MaxInt32) (Char -1) (Char -1) (Char -1)]]
145+
;; In go, char == rune, which is equivalent to int32 ;; system-dependent
146+
[unchecked-char [(Char -1) (Char 0) (Char 1) (Char 127) (Char 32767) (Char math.MaxInt32) (Char -1) :skip :skip]]
147147
;; bytes are unsigned in go
148148
[byte [255 0 1 math.MaxInt8 :error :error :error :error :error]]
149-
;; bytes are unsigned in go
150-
[unchecked-byte [255 0 1 math.MaxInt8 255 255 255 255 255]]
149+
;; bytes are unsigned in go ;; system-dependent
150+
[unchecked-byte [255 0 1 math.MaxInt8 255 255 255 :skip :skip]]
151151
[short [-1 0 1 math.MaxInt8 math.MaxInt16 :error :error :error :error]]
152-
[unchecked-short [-1 0 1 math.MaxInt8 math.MaxInt16 -1 -1 -1 -1]]
152+
;; ;; system-dependent
153+
[unchecked-short [-1 0 1 math.MaxInt8 math.MaxInt16 -1 -1 :skip :skip]]
153154
[int [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 max-int-res :error :error]]
154-
[unchecked-int [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 max-int-res max-int-res max-int-res]]
155+
;; ;; system-dependent
156+
[unchecked-int [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 max-int-res :skip :skip]]
155157
[long [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 math.MaxInt64 :error :error]]
156-
[unchecked-long [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 math.MaxInt64 math.MaxInt64 math.MaxInt64]]
158+
;; ;; system-dependent
159+
[unchecked-long [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 math.MaxInt64 :skip :skip]]
157160
;; 2.14748365E9 if when float/double conversion is avoided...
158161
[float [-1.0 0.0 1.0 127.0 32767.0 2.147483648E9 9.223372036854776E18 math.MaxFloat32 :error]]
159162
[unchecked-float [-1.0 0.0 1.0 127.0 32767.0 2.147483648E9 9.223372036854776E18 math.MaxFloat32 (go/float32 (math.Inf 1))]]
@@ -163,11 +166,13 @@
163166
(deftest test-expected-casts
164167
(let [[[_ inputs] & expectations] expected-casts]
165168
(doseq [[f vals] expectations]
166-
(let [wrapped (fn [x]
167-
(try
168-
(f x)
169-
(catch go/any e :error)))]
170-
(is (= vals (map wrapped inputs)))))))
169+
(let [wrapped (fn [x expected]
170+
(if (= expected :skip)
171+
expected
172+
(try
173+
(f x)
174+
(catch go/any e :error))))]
175+
(is (= vals (map wrapped inputs vals)))))))
171176

172177
(deftest test-prim-with-matching-hint
173178
(is (= 1.0 (let [x 1.2] (math.Round ^go/float64 x)))))

0 commit comments

Comments
 (0)