Skip to content

Commit c7461f9

Browse files
committed
Add lots more transcript tests
1 parent 201cde6 commit c7461f9

12 files changed

Lines changed: 38 additions & 2 deletions

tests/test_transcript.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,19 @@ def test_invalid_syntax(_cmdline_app, capsys):
240240

241241

242242
@pytest.mark.parametrize('filename, feedback_to_output', [
243-
('regex_set.txt', False),
244-
('multiline.txt', False),
243+
('bol_eol.txt', False),
244+
('characterclass.txt', False),
245+
('dotstar.txt', False),
246+
('extension_notation.txt', False),
245247
('from_cmdloop.txt', True),
248+
('multiline_no_regex.txt', False),
249+
('multiline_regex.txt', False),
250+
('regex_set.txt', False),
251+
('singleslash.txt', False),
252+
('slashdot.txt', False),
253+
('slashslash_escaped.txt', False),
254+
('slashslash.txt', False),
255+
('spaces.txt', False),
246256
])
247257
def test_transcript(request, capsys, filename, feedback_to_output):
248258
# Create a cmd2.Cmd() instance and make sure basic settings are like we want for test

tests/transcripts/bol_eol.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(Cmd) say -r 3 -s yabba dabba do
2+
/^Y.*?$/
3+
/^Y.*?$/
4+
/^Y.*?$/
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(Cmd) say 555-1212
2+
/[0-9]{3}-[0-9]{4}/

tests/transcripts/dotstar.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(Cmd) say Adopt the pace of nature: her secret is patience.
2+
Adopt the pace of /.*/ is patience.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(Cmd) say (?:fred)
2+
/(?:\(\?:fred\))/
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(Cmd) say -r 3 -s yabba dabba do
2+
/\A(YA.*?DO\n?){3}/

tests/transcripts/singleslash.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(Cmd) say use 2/3 cup of sugar
2+
use 2/3 cup of sugar

tests/transcripts/slashdot.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(Cmd) say mix 2/3 c. sugar, 1/2 c. butter, and 1/2 tsp. salt
2+
mix 2/3 c. sugar, 1/2 c. butter, and 1/2 tsp. salt

tests/transcripts/slashslash.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(Cmd) say //
2+
//

0 commit comments

Comments
 (0)