• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

C preprocessor written in Python


Commit MetaInfo

修订版d1f9849f38191cc29bea0c006894e18b930dc868 (tree)
时间2022-02-01 15:50:07
作者Eric Hopper <hopper@omni...>
CommiterEric Hopper

Log Message

Add test of negative indexes.

更改概述

差异

diff -r 962505cdb449 -r d1f9849f3819 tests/test_lazy_sequence.py
--- a/tests/test_lazy_sequence.py Mon Jan 31 22:45:43 2022 -0800
+++ b/tests/test_lazy_sequence.py Mon Jan 31 22:50:07 2022 -0800
@@ -34,6 +34,15 @@
3434 del tmp
3535 gc.collect()
3636
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+
3746 assert ls.index == 2
3847 assert len(ls.state.heads) == 1
3948 assert len(ls.state.buffer) == 0