summaryrefslogtreecommitdiff
path: root/tests/test_transcript.py
diff options
context:
space:
mode:
authorJared Crapo <jared@kotfu.net>2017-08-22 11:14:03 -0600
committerJared Crapo <jared@kotfu.net>2017-08-22 11:14:03 -0600
commite3f88038367d6c6ec617ddc84dfcdb91f0dceccf (patch)
tree563c0f384fea30e97b378b51609391f23dcb815a /tests/test_transcript.py
parentdeeeeab563854bea6a616a6746ee47915f9fd641 (diff)
downloadcmd2-git-e3f88038367d6c6ec617ddc84dfcdb91f0dceccf.tar.gz
Fix a bug if there is only one slash
Diffstat (limited to 'tests/test_transcript.py')
-rw-r--r--tests/test_transcript.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_transcript.py b/tests/test_transcript.py
index 9928be15..5092a2cd 100644
--- a/tests/test_transcript.py
+++ b/tests/test_transcript.py
@@ -310,14 +310,18 @@ def test_transcript(request, capsys, filename, feedback_to_output):
@pytest.mark.parametrize('expected, transformed', [
( 'text with no slashes', 'text\ with\ no\ slashes' ),
+ # stuff with just one slash
+ ( 'use 2/3 cup', 'use\ 2\/3\ cup' ),
+ ( '/tmp is nice', '\/tmp\ is\ nice'),
+ ( 'slash at end/', 'slash\ at\ end\/'),
+ # regexes
( 'specials .*', 'specials\ \.\*' ),
( '/.*/', '.*' ),
- ( 'use 2\/3 cup', 'use\ 2\/3\ cup' ),
( 'specials ^ and + /[0-9]+/', 'specials\ \^\ and\ \+\ [0-9]+' ),
- ( '/a{6}/ but not a{6} with /.*?/ more', 'a{6}\ but\ not\ a\{6\}\ with\ .*?\ more' ),
+ ( '/a{6}/ but not \/a{6} with /.*?/ more', 'a{6}\ but\ not\ \/a\{6\}\ with\ .*?\ more' ),
( 'not this slash\/ or this one\/', 'not\ this\ slash\\/\ or\ this\ one\\/' ),
( 'not \/, use /\|?/, not \/', 'not\ \\/\,\ use\ \|?\,\ not\ \\/' ),
- # inception: we have a slashes in our regex: backslashed on input, bare on output
+ # inception: slashes in our regex. backslashed on input, bare on output
( 'not \/, use /\/?/, not \/', 'not\ \\/\,\ use\ /?\,\ not\ \\/' ),
( 'the /\/?/ more /.*/ stuff', 'the\ /?\ more\ .*\ stuff' ),
])