diff options
author | Jared Crapo <jared@kotfu.net> | 2017-08-20 21:37:30 -0600 |
---|---|---|
committer | Jared Crapo <jared@kotfu.net> | 2017-08-20 21:38:39 -0600 |
commit | c7461f9b6cb675513dc73ba8c1d98420a93c9dd3 (patch) | |
tree | 740b78f8250db79631322a7caffcef635354ef41 /tests | |
parent | 201cde6e6b0715c17f596f7872925799202ca279 (diff) | |
download | cmd2-git-c7461f9b6cb675513dc73ba8c1d98420a93c9dd3.tar.gz |
Add lots more transcript tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_transcript.py | 14 | ||||
-rw-r--r-- | tests/transcripts/bol_eol.txt | 4 | ||||
-rw-r--r-- | tests/transcripts/characterclass.txt | 2 | ||||
-rw-r--r-- | tests/transcripts/dotstar.txt | 2 | ||||
-rw-r--r-- | tests/transcripts/extension_notation.txt | 2 | ||||
-rw-r--r-- | tests/transcripts/multiline_no_regex.txt (renamed from tests/transcripts/multiline.txt) | 0 | ||||
-rw-r--r-- | tests/transcripts/multiline_regex.txt | 2 | ||||
-rw-r--r-- | tests/transcripts/singleslash.txt | 2 | ||||
-rw-r--r-- | tests/transcripts/slashdot.txt | 2 | ||||
-rw-r--r-- | tests/transcripts/slashslash.txt | 2 | ||||
-rw-r--r-- | tests/transcripts/slashslash_escaped.txt | 2 | ||||
-rw-r--r-- | tests/transcripts/spaces.txt | 6 |
12 files changed, 38 insertions, 2 deletions
diff --git a/tests/test_transcript.py b/tests/test_transcript.py index 2241b5b7..adc162b1 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -240,9 +240,19 @@ def test_invalid_syntax(_cmdline_app, capsys): @pytest.mark.parametrize('filename, feedback_to_output', [ - ('regex_set.txt', False), - ('multiline.txt', False), + ('bol_eol.txt', False), + ('characterclass.txt', False), + ('dotstar.txt', False), + ('extension_notation.txt', False), ('from_cmdloop.txt', True), + ('multiline_no_regex.txt', False), + ('multiline_regex.txt', False), + ('regex_set.txt', False), + ('singleslash.txt', False), + ('slashdot.txt', False), + ('slashslash_escaped.txt', False), + ('slashslash.txt', False), + ('spaces.txt', False), ]) def test_transcript(request, capsys, filename, feedback_to_output): # Create a cmd2.Cmd() instance and make sure basic settings are like we want for test diff --git a/tests/transcripts/bol_eol.txt b/tests/transcripts/bol_eol.txt new file mode 100644 index 00000000..c80ee54e --- /dev/null +++ b/tests/transcripts/bol_eol.txt @@ -0,0 +1,4 @@ +(Cmd) say -r 3 -s yabba dabba do +/^Y.*?$/ +/^Y.*?$/ +/^Y.*?$/ diff --git a/tests/transcripts/characterclass.txt b/tests/transcripts/characterclass.txt new file mode 100644 index 00000000..89903f3a --- /dev/null +++ b/tests/transcripts/characterclass.txt @@ -0,0 +1,2 @@ +(Cmd) say 555-1212 +/[0-9]{3}-[0-9]{4}/ diff --git a/tests/transcripts/dotstar.txt b/tests/transcripts/dotstar.txt new file mode 100644 index 00000000..a0e3f181 --- /dev/null +++ b/tests/transcripts/dotstar.txt @@ -0,0 +1,2 @@ +(Cmd) say Adopt the pace of nature: her secret is patience. +Adopt the pace of /.*/ is patience. diff --git a/tests/transcripts/extension_notation.txt b/tests/transcripts/extension_notation.txt new file mode 100644 index 00000000..3b538790 --- /dev/null +++ b/tests/transcripts/extension_notation.txt @@ -0,0 +1,2 @@ +(Cmd) say (?:fred) +/(?:\(\?:fred\))/ diff --git a/tests/transcripts/multiline.txt b/tests/transcripts/multiline_no_regex.txt index 5fe9122c..5fe9122c 100644 --- a/tests/transcripts/multiline.txt +++ b/tests/transcripts/multiline_no_regex.txt diff --git a/tests/transcripts/multiline_regex.txt b/tests/transcripts/multiline_regex.txt new file mode 100644 index 00000000..76c67c10 --- /dev/null +++ b/tests/transcripts/multiline_regex.txt @@ -0,0 +1,2 @@ +(Cmd) say -r 3 -s yabba dabba do +/\A(YA.*?DO\n?){3}/ diff --git a/tests/transcripts/singleslash.txt b/tests/transcripts/singleslash.txt new file mode 100644 index 00000000..00d0ba21 --- /dev/null +++ b/tests/transcripts/singleslash.txt @@ -0,0 +1,2 @@ +(Cmd) say use 2/3 cup of sugar +use 2/3 cup of sugar diff --git a/tests/transcripts/slashdot.txt b/tests/transcripts/slashdot.txt new file mode 100644 index 00000000..83b5870e --- /dev/null +++ b/tests/transcripts/slashdot.txt @@ -0,0 +1,2 @@ +(Cmd) say mix 2/3 c. sugar, 1/2 c. butter, and 1/2 tsp. salt +mix 2/3 c. sugar, 1/2 c. butter, and 1/2 tsp. salt diff --git a/tests/transcripts/slashslash.txt b/tests/transcripts/slashslash.txt new file mode 100644 index 00000000..a6d37456 --- /dev/null +++ b/tests/transcripts/slashslash.txt @@ -0,0 +1,2 @@ +(Cmd) say // +// diff --git a/tests/transcripts/slashslash_escaped.txt b/tests/transcripts/slashslash_escaped.txt new file mode 100644 index 00000000..706f1079 --- /dev/null +++ b/tests/transcripts/slashslash_escaped.txt @@ -0,0 +1,2 @@ +(Cmd) say // +\/\/ diff --git a/tests/transcripts/spaces.txt b/tests/transcripts/spaces.txt new file mode 100644 index 00000000..b4cdfa02 --- /dev/null +++ b/tests/transcripts/spaces.txt @@ -0,0 +1,6 @@ +(Cmd) say how many spaces +how many spaces +(Cmd) say how many spaces +how/\s+/many/\s+/spaces +(Cmd) say "how many spaces" +how/\s+/many/\s+/spaces |