Add bound check for list and range (#185) #255
|
@ -229,7 +229,7 @@ def list_slice_assignment():
|
|||
bl5[3:-5] = []
|
||||
output_int32_list([int32(b) for b in bl5])
|
||||
bl6 = bl[:]
|
||||
bl6[3:-5] = [True, False, False]
|
||||
bl6[3:-5] = [True, False]
|
||||
pca006132 marked this conversation as resolved
|
||||
output_int32_list([int32(b) for b in bl6])
|
||||
bl7 = bl[:]
|
||||
bl7[:-2] = [False]
|
||||
|
|
Loading…
Reference in New Issue
what is this?
This is the 'fix broken test' commit. This test should not pass because the length of
bl6
is 10, sobl[3:-5]
isbl[3,5]
, which has length 2, so this test is actually extending the list, which is not supported.Previously this test happened to accidentally pass because we do not have the check on the list slice assignment yet, and the value of the assignment accidentally make the test pass. In fact, just by changing the
bl6[3:-5] = [True, False, False]
tobl6[3:-5] = [True, False, True]
or something else, this test will fail before this PR.