Skip to content
Snippets Groups Projects
Commit ced90028 authored by Wilson Jallet's avatar Wilson Jallet :clapper:
Browse files

[unittest/python] update test_std_array.py

parent 5e601842
No related branches found
No related tags found
No related merge requests found
Pipeline #33557 passed with warnings
......@@ -6,14 +6,30 @@ print(ints[0])
print(ints[1])
print(ints[2])
_ints_slice = ints[1:2]
assert len(_ints_slice) == 2, "Slice size should be 2, got %d" % len(_ints_slice)
assert _ints_slice[0] == 1
assert _ints_slice[1] == 2
_ints_slice = ints[1:3]
print("Printing slice...")
for el in _ints_slice:
print(el)
print(ints.tolist())
ref = [1, 2, 3]
assert len(ref[1:2]) == 1 # sanity check
assert len(_ints_slice) == 2, "Slice size should be 1, got %d" % len(_ints_slice)
assert _ints_slice[0] == 2
assert _ints_slice[1] == 3
# print(ints.tolist())
vecs = std_array.get_arr_3_vecs()
print(vecs[0])
print(vecs[1])
print(vecs[2])
assert len(vecs) == 3
# print(vecs[0])
# print(vecs[1])
# print(vecs[2])
## Tests for the full-size slice
v2 = vecs[:]
assert isinstance(v2, std_array.StdVec_VectorXd)
assert len(v2) == 3
print(v2.tolist())
print(v2[0])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment