summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-05-31 22:07:34 -0700
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-05-31 22:07:34 -0700
commita803f4cba59e98adaee0f488a3b103b6c61fc9cc (patch)
tree46d002f421e5770981c757de0737422b78baf93f
parent98522702b9131c41741af07f7acdf74b7f25d4d7 (diff)
downloadcmd2-git-a803f4cba59e98adaee0f488a3b103b6c61fc9cc.tar.gz
Added a unit test to help better cover rl_utils.py
-rw-r--r--tests/test_cmd2.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 68aa0b98..24a14ea2 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -1739,3 +1739,12 @@ def test_parseline(base_app):
assert command == 'command'
assert args == "with 'partially completed quotes"
assert line == statement.strip()
+
+
+def test_readline_remove_history_item(base_app):
+ from cmd2.rl_utils import readline
+ assert readline.get_current_history_length() == 0
+ readline.add_history('this is a test')
+ assert readline.get_current_history_length() == 1
+ readline.remove_history_item(0)
+ assert readline.get_current_history_length() == 0