summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md5
-rwxr-xr-xcmd2.py10
-rw-r--r--docs/conf.py2
-rwxr-xr-xsetup.py2
-rw-r--r--tests/test_cmd2.py2
5 files changed, 13 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 02ae8f45..230fa774 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,11 @@
* For ``edit`` command, both **editor** and **filename** can now have spaces in the name/path
* Enhancements
* ``feedback_to_output`` now defaults to ``False`` so info like command timing won't redirect
+ * Transcript regexes now have predictable, tested, and documented behavior
+ * This makes a breaking change to the format and expectations of transcript testing
+ * The prior behavior removed whitespace before making the comparison
+ * This new version does not, whitespace must match exactly
+ * Transcripts now support a vastly expanded subset of all possible regexes
## 0.7.6 (August 11, 2017)
diff --git a/cmd2.py b/cmd2.py
index f4eb3b00..2b43e1ae 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -98,7 +98,7 @@ if six.PY3:
else:
BROKEN_PIPE_ERROR = IOError
-__version__ = '0.7.7a'
+__version__ = '0.7.7'
# Pyparsing enablePackrat() can greatly speed up parsing, but problems have been seen in Python 3 in the past
pyparsing.ParserElement.enablePackrat()
@@ -2305,7 +2305,7 @@ class Cmd2TestCase(unittest.TestCase):
break
line_num += 1
expected = ''.join(expected)
-
+
# transform the expected text into a valid regular expression
expected = self._transform_transcript_expected(expected)
message = '\nFile {}, line {}\nCommand was:\n{}\nExpected:\n{}\nGot:\n{}\n'.format(
@@ -2318,7 +2318,7 @@ class Cmd2TestCase(unittest.TestCase):
backslash = '\\'
regex = ''
start = 0
-
+
while True:
(regex, first_slash_pos, start) = self._escaped_find(regex, s, start, False)
if first_slash_pos == -1:
@@ -2349,12 +2349,12 @@ class Cmd2TestCase(unittest.TestCase):
def _escaped_find(self, regex, s, start, in_regex):
"""
Find the next slash in {s} after {start} that is not preceded by a backslash.
-
+
If we find an escaped slash, add everything up to and including it to regex,
updating {start}. {start} therefore serves two purposes, tells us where to start
looking for the next thing, and also tells us where in {s} we have already
added things to {regex}
-
+
{in_regex} specifies whether we are currently searching in a regex, we behave
differently if we are or if we aren't.
"""
diff --git a/docs/conf.py b/docs/conf.py
index 52ca820b..f79d5b3c 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -62,7 +62,7 @@ author = 'Catherine Devlin and Todd Leonhardt'
# The short X.Y version.
version = '0.7'
# The full version, including alpha/beta/rc tags.
-release = '0.7.7a'
+release = '0.7.7'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.py b/setup.py
index a3ec6c79..7d2821e4 100755
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ Setuptools setup file, used to install or test 'cmd2'
"""
from setuptools import setup
-VERSION = '0.7.7a'
+VERSION = '0.7.7'
DESCRIPTION = "cmd2 - a tool for building interactive command line applications in Python"
LONG_DESCRIPTION = """cmd2 is a tool for building interactive command line applications in Python. Its goal is to make
it quick and easy for developers to build feature-rich and user-friendly interactive command line applications. It
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 10631ffa..51421bcb 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -23,7 +23,7 @@ from conftest import run_cmd, normalize, BASE_HELP, HELP_HISTORY, SHORTCUTS_TXT,
def test_ver():
- assert cmd2.__version__ == '0.7.7a'
+ assert cmd2.__version__ == '0.7.7'
def test_empty_statement(base_app):