C preprocessor written in Python
| Revision | d1f9849f38191cc29bea0c006894e18b930dc868 (tree) |
|---|---|
| Time | 2022-02-01 15:50:07 |
| Author | Eric Hopper <hopper@omni...> |
| Commiter | Eric Hopper |
Add test of negative indexes.
| @@ -34,6 +34,15 @@ | ||
| 34 | 34 | del tmp |
| 35 | 35 | gc.collect() |
| 36 | 36 | |
| 37 | + with pytest.raises(ValueError): | |
| 38 | + assert ls[-1] == 25 | |
| 39 | + | |
| 40 | + with pytest.raises(ValueError): | |
| 41 | + assert ls[-1:] == [25] | |
| 42 | + | |
| 43 | + with pytest.raises(ValueError): | |
| 44 | + assert ls[:-1] == [9, 16, 25] | |
| 45 | + | |
| 37 | 46 | assert ls.index == 2 |
| 38 | 47 | assert len(ls.state.heads) == 1 |
| 39 | 48 | assert len(ls.state.buffer) == 0 |