forked from M-Labs/artiq
compiler: Add test for length of empty arrays [nfc]
This makes sure we are actually emitting this as an 1D array (like NumPy does).
This commit is contained in:
parent
d882f8a3f0
commit
40f59561f2
|
@ -6,5 +6,10 @@ assert len(ary) == 3
|
||||||
# FIXME: Implement ndarray indexing
|
# FIXME: Implement ndarray indexing
|
||||||
# assert [x*x for x in ary] == [1, 4, 9]
|
# assert [x*x for x in ary] == [1, 4, 9]
|
||||||
|
|
||||||
|
# Reassign to an existing value to disambiguate type of empty array.
|
||||||
|
empty_array = array([1])
|
||||||
|
empty_array = array([])
|
||||||
|
assert len(empty_array) == 0
|
||||||
|
|
||||||
matrix = array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
|
matrix = array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
|
||||||
assert len(matrix) == 2
|
assert len(matrix) == 2
|
||||||
|
|
Loading…
Reference in New Issue