Commit d1674497 authored by Adam Procter's avatar Adam Procter

More element type coverage because hey why not

parent c8691054
This diff is collapsed.
...@@ -519,7 +519,7 @@ def main(): ...@@ -519,7 +519,7 @@ def main():
t = SliceTestWriter(stream=f) t = SliceTestWriter(stream=f)
t.set_shape((4,)) t.set_shape((4,))
for dt in ['int32','float32']: for dt in ['int32','int64','float32','uint32']:
t.set_dtype(dt) t.set_dtype(dt)
t[np.newaxis,3:0:-1] t[np.newaxis,3:0:-1]
...@@ -553,6 +553,7 @@ def main(): ...@@ -553,6 +553,7 @@ def main():
# A couple of tests for negative-stride slicing. The issue we want to # A couple of tests for negative-stride slicing. The issue we want to
# be on the lookout for is this: # be on the lookout for is this:
# #
# [ORIGINAL]
# 01234567 # 01234567
# ..1..0.. [5:0:-3] # suppose we start with this, want to convert # ..1..0.. [5:0:-3] # suppose we start with this, want to convert
# _____ # to pos stride. suppose that our stride is # _____ # to pos stride. suppose that our stride is
...@@ -561,6 +562,7 @@ def main(): ...@@ -561,6 +562,7 @@ def main():
# # multiple of the strides (e.g. here: we get # # multiple of the strides (e.g. here: we get
# # elements 5 and 2.) # # elements 5 and 2.)
# #
# [INCORRECT]
# 01234567 # 01234567
# .0..1... [1:6:3] # if we just reverse the sign of the stride # .0..1... [1:6:3] # if we just reverse the sign of the stride
# _____ # and flip the start/end indices while # _____ # and flip the start/end indices while
...@@ -568,6 +570,7 @@ def main(): ...@@ -568,6 +570,7 @@ def main():
# # elements. (e.g. here: we get elements 1 and # # elements. (e.g. here: we get elements 1 and
# # 4, which are not what we want.) # # 4, which are not what we want.)
# #
# [CORRECT]
# 01234567 # 01234567
# ..0..1.. [2:6:3] # the correct thing to do is to adjust the # ..0..1.. [2:6:3] # the correct thing to do is to adjust the
# ____ # start of our reversed slice to be the last # ____ # start of our reversed slice to be the last
...@@ -602,7 +605,7 @@ def main(): ...@@ -602,7 +605,7 @@ def main():
t[::0] # error expected (stride==0) t[::0] # error expected (stride==0)
t.set_shape((2,3,4)) t.set_shape((2,3,4))
for dt in ['int32','float32']: for dt in ['int32','int64','float32','uint32']:
t.set_dtype(dt) t.set_dtype(dt)
t[1,np.newaxis] t[1,np.newaxis]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment