|
142 | 142 | [ |
143 | 143 | [:input [-1 0 1 math.MaxInt8 math.MaxInt16 math.MaxInt32 math.MaxInt64 math.MaxFloat32 math.MaxFloat64]] |
144 | 144 | [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]] |
147 | 147 | ;; bytes are unsigned in go |
148 | 148 | [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]] |
151 | 151 | [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]] |
153 | 154 | [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]] |
155 | 157 | [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]] |
157 | 160 | ;; 2.14748365E9 if when float/double conversion is avoided... |
158 | 161 | [float [-1.0 0.0 1.0 127.0 32767.0 2.147483648E9 9.223372036854776E18 math.MaxFloat32 :error]] |
159 | 162 | [unchecked-float [-1.0 0.0 1.0 127.0 32767.0 2.147483648E9 9.223372036854776E18 math.MaxFloat32 (go/float32 (math.Inf 1))]] |
|
163 | 166 | (deftest test-expected-casts |
164 | 167 | (let [[[_ inputs] & expectations] expected-casts] |
165 | 168 | (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))))))) |
171 | 176 |
|
172 | 177 | (deftest test-prim-with-matching-hint |
173 | 178 | (is (= 1.0 (let [x 1.2] (math.Round ^go/float64 x))))) |
|
0 commit comments