Add tests
This commit is contained in:
parent
e1fe03d236
commit
b868903a81
2 changed files with 32 additions and 9 deletions
29
tests.bqn
29
tests.bqn
|
@ -1,11 +1,5 @@
|
|||
⟨SaveNpy,LoadNpy⟩←•Import"npy.bqn"
|
||||
|
||||
a←3‿4‿5•rand.Range 0
|
||||
"testbqn.npy"SaveNpy a
|
||||
b←LoadNpy"testbqn.npy"
|
||||
! a≡○≢b
|
||||
! a≡b
|
||||
|
||||
floatArr←2‿3•rand.Range 0
|
||||
intArr←50-˜2‿3•rand.Range 100
|
||||
uintArr←2‿3•rand.Range 100
|
||||
|
@ -14,6 +8,23 @@ uintArr←2‿3•rand.Range 100
|
|||
"test_int.npy"SaveNpy intArr
|
||||
"test_uint.npy"SaveNpy uintArr
|
||||
|
||||
floatArr≡LoadNpy"test_float.npy"
|
||||
intArr≡LoadNpy"test_int.npy"
|
||||
uintArr≡LoadNpy"test_uint.npy"
|
||||
! floatArr≡LoadNpy"test_float.npy"
|
||||
! intArr≡LoadNpy"test_int.npy"
|
||||
! uintArr≡LoadNpy"test_uint.npy"
|
||||
|
||||
# Supported dtypes
|
||||
ref←2‿3‿4⥊0
|
||||
! ref≡LoadNpy"test<f8.npy"
|
||||
! ref≡LoadNpy"test<i4.npy"
|
||||
! ref≡LoadNpy"test<u4.npy"
|
||||
# Unsupported dtypes, should raise an error
|
||||
! LoadNpy⎊1"test<f4.npy"
|
||||
! LoadNpy⎊1"test<i8.npy"
|
||||
! LoadNpy⎊1"test<u8.npy"
|
||||
! LoadNpy⎊1"test>f4.npy"
|
||||
! LoadNpy⎊1"test>f8.npy"
|
||||
! LoadNpy⎊1"test>i4.npy"
|
||||
! LoadNpy⎊1"test>i8.npy"
|
||||
! LoadNpy⎊1"test>u4.npy"
|
||||
! LoadNpy⎊1"test>u8.npy"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue