From c7461f9b6cb675513dc73ba8c1d98420a93c9dd3 Mon Sep 17 00:00:00 2001 From: Jared Crapo Date: Sun, 20 Aug 2017 21:37:30 -0600 Subject: Add lots more transcript tests --- tests/transcripts/bol_eol.txt | 4 ++++ tests/transcripts/characterclass.txt | 2 ++ tests/transcripts/dotstar.txt | 2 ++ tests/transcripts/extension_notation.txt | 2 ++ tests/transcripts/multiline.txt | 10 ---------- tests/transcripts/multiline_no_regex.txt | 10 ++++++++++ tests/transcripts/multiline_regex.txt | 2 ++ tests/transcripts/singleslash.txt | 2 ++ tests/transcripts/slashdot.txt | 2 ++ tests/transcripts/slashslash.txt | 2 ++ tests/transcripts/slashslash_escaped.txt | 2 ++ tests/transcripts/spaces.txt | 6 ++++++ 12 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 tests/transcripts/bol_eol.txt create mode 100644 tests/transcripts/characterclass.txt create mode 100644 tests/transcripts/dotstar.txt create mode 100644 tests/transcripts/extension_notation.txt delete mode 100644 tests/transcripts/multiline.txt create mode 100644 tests/transcripts/multiline_no_regex.txt create mode 100644 tests/transcripts/multiline_regex.txt create mode 100644 tests/transcripts/singleslash.txt create mode 100644 tests/transcripts/slashdot.txt create mode 100644 tests/transcripts/slashslash.txt create mode 100644 tests/transcripts/slashslash_escaped.txt create mode 100644 tests/transcripts/spaces.txt (limited to 'tests/transcripts') 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.txt deleted file mode 100644 index 5fe9122c..00000000 --- a/tests/transcripts/multiline.txt +++ /dev/null @@ -1,10 +0,0 @@ -# cmd2 will skip any lines -# which occur before a valid -# command prompt - -(Cmd) orate This is a test -> of the -> emergency broadcast system -This is a test -of the -emergency broadcast system diff --git a/tests/transcripts/multiline_no_regex.txt b/tests/transcripts/multiline_no_regex.txt new file mode 100644 index 00000000..5fe9122c --- /dev/null +++ b/tests/transcripts/multiline_no_regex.txt @@ -0,0 +1,10 @@ +# cmd2 will skip any lines +# which occur before a valid +# command prompt + +(Cmd) orate This is a test +> of the +> emergency broadcast system +This is a test +of the +emergency broadcast system 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 -- cgit v1.2.1