Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add simple test for sum()
  • Loading branch information
v923z committed Nov 30, 2021
commit e655c9410812c0dfa3685dff118ae84cb17b26e1
21 changes: 21 additions & 0 deletions tests/1d/numpy/sum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from ulab import numpy as np

r = range(15)

a = np.array(r, dtype=np.uint8)
print(np.sum(a))

a = np.array(r, dtype=np.int8)
print(np.sum(a))

a = np.array(r, dtype=np.uint16)
print(np.sum(a))

a = np.array(r, dtype=np.int16)
print(np.sum(a))

a = np.array(r, dtype=np.float)
print(np.sum(a))

a = np.array([False] + [True]*15, dtype=np.bool)
print(np.sum(a))
6 changes: 6 additions & 0 deletions tests/1d/numpy/sum.py.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
105
105
105
105
105.0
15