Skip to content

Commit be13c12

Browse files
committed
Omit float unchecked number conversion tests
Conversion to int64 is inconsistent across platforms Signed-off-by: James Hamlin <[email protected]>
1 parent 5ecbace commit be13c12

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/glojure/test_glojure/numbers.glj

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,21 @@
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]]
145145
;; 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)]]
146+
;; TODO BUG: math.MaxFloat32 and math.MaxFloat64 convert to int64 inconcistently across platforms
147+
;; [unchecked-char [(Char -1) (Char 0) (Char 1) (Char 127) (Char 32767) (Char math.MaxInt32) (Char -1) (Char -1) (Char -1)]]
147148
[byte [255 0 1 math.MaxInt8 :error :error :error :error :error]]
148149
;; bytes are unsigned in go
149-
[unchecked-byte [255 0 1 math.MaxInt8 255 255 255 255 255]]
150+
;; TODO BUG: math.MaxFloat32 and math.MaxFloat64 convert to int64 inconcistently across platforms
151+
;; [unchecked-byte [255 0 1 math.MaxInt8 255 255 255 255 255]]
150152
[short [-1 0 1 math.MaxInt8 math.MaxInt16 :error :error :error :error]]
151-
[unchecked-short [-1 0 1 math.MaxInt8 math.MaxInt16 -1 -1 -1 -1]]
153+
;; TODO BUG: math.MaxFloat32 and math.MaxFloat64 convert to int64 inconcistently across platforms
154+
;; [unchecked-short [-1 0 1 math.MaxInt8 math.MaxInt16 -1 -1 -1 -1]]
152155
[int [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 max-int-res :error :error]]
153-
[unchecked-int [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 max-int-res max-int-res max-int-res]]
156+
;; TODO BUG: math.MaxFloat32 and math.MaxFloat64 convert to int64 inconcistently across platforms
157+
;; [unchecked-int [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 max-int-res max-int-res max-int-res]]
154158
[long [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 math.MaxInt64 :error :error]]
155-
[unchecked-long [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 math.MaxInt64 math.MaxInt64 math.MaxInt64]]
159+
;; TODO BUG: math.MaxFloat32 and math.MaxFloat64 convert to int64 inconcistently across platforms
160+
;; [unchecked-long [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 math.MaxInt64 math.MaxInt64 math.MaxInt64]]
156161
;; 2.14748365E9 if when float/double conversion is avoided...
157162
[float [-1.0 0.0 1.0 127.0 32767.0 2.147483648E9 9.223372036854776E18 math.MaxFloat32 :error]]
158163
[unchecked-float [-1.0 0.0 1.0 127.0 32767.0 2.147483648E9 9.223372036854776E18 math.MaxFloat32 (go/float32 (math.Inf 1))]]

0 commit comments

Comments
 (0)