3 ints = std_array.get_arr_3_ints()
8 assert ints.tolist() == [1, 2, 3]
10 _ints_slice = ints[1:3]
11 print(
"Printing slice...")
12 for el
in _ints_slice:
16 assert len(ref[1:2]) == 1
18 assert len(_ints_slice) == 2,
"Slice size should be 1, got %d" % len(_ints_slice)
19 assert _ints_slice[0] == 2
20 assert _ints_slice[1] == 3
27 except NotImplementedError:
30 assert False,
"Insert value with slice operator should be impossible"
35 except NotImplementedError:
38 assert False,
"Insert value with slice operator should be impossible"
43 except NotImplementedError:
46 assert False,
"Insert value with slice operator should be impossible"
51 except NotImplementedError:
54 assert False,
"Insert value with slice operator should be impossible"
59 except NotImplementedError:
62 assert False,
"Insert value with slice operator should be impossible"
68 except NotImplementedError:
71 assert False,
"del is not implemented"
76 except NotImplementedError:
79 assert False,
"del is not implemented"
84 except NotImplementedError:
87 assert False,
"del is not implemented"
93 except AttributeError:
96 assert False,
"append is not implemented"
101 except AttributeError:
104 assert False,
"extend is not implemented"
113 vecs = std_array.get_arr_3_vecs()
114 assert len(vecs) == 3
127 ts = std_array.test_struct()
128 assert len(ts.integs) == 3
129 assert len(ts.vecs) == 2
130 print(ts.integs[:].tolist())
135 print(
"Test of set_slice for std::array<int>:", ts.integs[:].tolist())