Skip to content

Commit 27d5785

Browse files
committed
Added a unit test for HistoryItem.pr() in the case of non-verbose, non-expanded multiline commands
Also: - Updated CHANGELOG to reflect that 0.9.13 release is planned for June 2019
1 parent 547d4b8 commit 27d5785

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 0.9.13 (TBD, 2019)
1+
## 0.9.13 (June TBD, 2019)
22
* Bug Fixes
33
* Fixed issue where the wrong terminator was being appended by `Statement.expanded_command_line()`
44
* Fixed issue where aliases and macros could not contain terminator characters in their values

tests/test_history.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,18 @@ def parser():
281281
return parser
282282

283283
def test_multiline_histitem(parser):
284+
from cmd2.history import History
285+
line = 'multiline foo\nbar\n\n'
286+
statement = parser.parse(line)
287+
history = History()
288+
history.append(statement)
289+
assert len(history) == 1
290+
hist_item = history[0]
291+
assert hist_item.raw == line
292+
pr_lines = hist_item.pr().splitlines()
293+
assert pr_lines[0].endswith('multiline foo bar')
294+
295+
def test_multiline_histitem_verbose(parser):
284296
from cmd2.history import History
285297
line = 'multiline foo\nbar\n\n'
286298
statement = parser.parse(line)

0 commit comments

Comments
 (0)