Repository navigation
Commit c0c2018
committed
pythongh-150449: add tests for negative-step slices with start <= stop
Exercise the case where step is negative but start <= stop, which
produces an empty slice. Verify that:
- blob[3:8:-1] returns b"" (no crash)
- blob[3:8:-1] = b"" is a no-op
- blob[3:8:-1] = b"abc" raises IndexError (wrong size)
Also add blob[5:5:-1] == b"" to cover the start == stop edge case.1 parent 85312b4 commit c0c2018
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1395 | 1395 | | |
1396 | 1396 | | |
1397 | 1397 | | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
1398 | 1402 | | |
1399 | 1403 | | |
1400 | 1404 | | |
| |||
1427 | 1431 | | |
1428 | 1432 | | |
1429 | 1433 | | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
1430 | 1443 | | |
1431 | 1444 | | |
1432 | 1445 | | |
| |||
0 commit comments