Skip to content

Commit e655c94

Browse files
committed
add simple test for sum()
1 parent a097744 commit e655c94

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/1d/numpy/sum.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from ulab import numpy as np
2+
3+
r = range(15)
4+
5+
a = np.array(r, dtype=np.uint8)
6+
print(np.sum(a))
7+
8+
a = np.array(r, dtype=np.int8)
9+
print(np.sum(a))
10+
11+
a = np.array(r, dtype=np.uint16)
12+
print(np.sum(a))
13+
14+
a = np.array(r, dtype=np.int16)
15+
print(np.sum(a))
16+
17+
a = np.array(r, dtype=np.float)
18+
print(np.sum(a))
19+
20+
a = np.array([False] + [True]*15, dtype=np.bool)
21+
print(np.sum(a))

tests/1d/numpy/sum.py.exp

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
105
2+
105
3+
105
4+
105
5+
105.0
6+
15

0 commit comments

Comments
 (0)