Skip to content

Commit d8a2b01

Browse files
committed
More tests
1 parent 0f8481b commit d8a2b01

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/test_decode.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,17 @@ def test_consistent_decodes_all_values(
260260
npivals = np.arange(
261261
np.iinfo(int_dtype).min, int(np.iinfo(int_dtype).max) + 1, dtype=int_dtype
262262
)
263-
npfvals = npivals.view(dtype=npfmt)
263+
npfvals = npivals.view(dtype=npfmt).astype(np.float64)
264+
265+
# Scalar version
264266
for i, npfval in zip(npivals, npfvals):
265267
val = decode_float(fmt, int(i))
266268
np.testing.assert_equal(val.fval, npfval)
267269

270+
# Vector version
271+
vals = decode_ndarray(fmt, npivals)
272+
np.testing.assert_equal(vals, npfvals)
273+
268274

269275
@pytest.mark.parametrize("v", [-1, 0x10000])
270276
def test_except(v: int) -> None:

0 commit comments

Comments
 (0)