summaryrefslogtreecommitdiff
path: root/tests/test_history.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2019-03-11 20:32:21 -0600
committerkotfu <kotfu@kotfu.net>2019-03-11 20:32:21 -0600
commitb84798cfb2e0da5422936dfcf406c227b6a09723 (patch)
tree9bada0c3368bbe420e49b67b122adfe4d0dfbe0f /tests/test_history.py
parenta4ff1a45b205171663559b0f7003ecf84face2aa (diff)
downloadcmd2-git-b84798cfb2e0da5422936dfcf406c227b6a09723.tar.gz
Negative ending history indices include the referenced command, instead of excluding it
Diffstat (limited to 'tests/test_history.py')
-rw-r--r--tests/test_history.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_history.py b/tests/test_history.py
index d9918b7a..9046e877 100644
--- a/tests/test_history.py
+++ b/tests/test_history.py
@@ -77,14 +77,14 @@ def test_history_class_span(hist):
assert hist.span('1..3') == ['first', 'second', 'third']
assert hist.span('1:3') == ['first', 'second', 'third']
- assert hist.span('2:-1') == ['second', 'third']
+ assert hist.span('2:-1') == ['second', 'third', 'fourth']
assert hist.span('-3:4') == ['second', 'third','fourth']
- assert hist.span('-4:-2') == ['first', 'second']
+ assert hist.span('-4:-2') == ['first', 'second', 'third']
- assert hist.span(':-2') == ['first', 'second']
- assert hist.span('..-2') == ['first', 'second']
+ assert hist.span(':-2') == ['first', 'second', 'third']
+ assert hist.span('..-2') == ['first', 'second', 'third']
- value_errors = ['fred', 'fred:joe', 'a..b', '2 ..', '1 : 3']
+ value_errors = ['fred', 'fred:joe', 'a..b', '2 ..', '1 : 3', '1:0', '0:3']
for tryit in value_errors:
with pytest.raises(ValueError):
hist.span(tryit)