Commits

Brian Kearns committed dfa3a3a

extra test

Comments (0)

Files changed (2)

pypy/module/micronumpy/test/test_numarray.py

         d = dtype([("x", "int", 3), ("y", "float", 5)])
 
         a = zeros((), dtype=d)
+        #assert a['x'].dtype == int
         #assert a['x'].shape == (3,)
         #assert (a['x'] == [0, 0, 0]).all()
 
 
         a[0]["x"][0] = 200
         assert a[0]["x"][0] == 200
+        a[1]["x"][2] = 123
+        assert (a[1]["x"] == [4, 5, 123]).all()
+        a[1]['y'][3] = 4
+        assert a[1]['y'][3] == 4
+        assert a['y'][1][3] == 4
+        a['y'][1][4] = 5
+        assert a[1]['y'][4] == 5
 
         d = dtype([("x", "int64", (2, 3))])
         a = array([([[1, 2, 3], [4, 5, 6]],)], dtype=d)

pypy/module/micronumpy/types.py

 
     @jit.unroll_safe
     def store(self, arr, i, ofs, box):
+        assert i == 0
         assert isinstance(box, interp_boxes.W_VoidBox)
+        assert box.dtype is box.arr.dtype
         for k in range(box.arr.dtype.get_size()):
             arr.storage[k + ofs] = box.arr.storage[k + box.ofs]