Skip to content

Commit a57c664

Browse files
committed
Added a unit test and updated changes
1 parent 64b3a88 commit a57c664

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ News
2323
* Added CmdResult namedtumple for returning and storing results
2424
* Added local file system path completion for ``edit``, ``load``, ``save``, and ``shell`` commands
2525
* Add shell command completion for ``shell`` command or ``!`` shortcut
26+
* Abbreviated multiline commands are no longer allowed (they never worked correctly anyways)
2627

2728
0.7.0
2829
-----

tests/test_parsing.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""
33
Unit/functional testing for helper functions/classes in the cmd2.py module.
44
5-
These are primarily tests related to parsing. Moreover, they are mostly a port of the old doctest tests which were
5+
These are primarily tests related to parsing. Moreover, they are mostly a port of the old doctest tests which were
66
problematic because they worked properly for some versions of pyparsing but not for others.
77
88
Copyright 2017 Todd Leonhardt <[email protected]>
@@ -247,6 +247,12 @@ def test_parse_multiline_ignores_terminators_in_comments(parser):
247247
assert results.terminator[0] == '\n'
248248
assert results.terminator[1] == '\n'
249249

250+
def test_parse_abbreviated_multiline_not_allowed(parser):
251+
line = 'multilin command\n'
252+
results = parser.parseString(line)
253+
assert results.command == 'multilin'
254+
assert results.multilineCommand == ''
255+
250256
# Unicode support is only present in cmd2 for Python 3
251257
@pytest.mark.skipif(sys.version_info < (3,0), reason="cmd2 unicode support requires python3")
252258
def test_parse_command_with_unicode_args(parser):

0 commit comments

Comments
 (0)