From f33e2e1ec9aef252952565644f6ebe02065f1943 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 9 Apr 2022 14:24:06 -0400 Subject: Added leading zeroes --- tests/01-literal.in | 5 +++++ tests/01-literal.out | 2 ++ tests/01-literal.sh | 3 +++ tests/02-char.in | 5 +++++ tests/02-char.out | 3 +++ tests/02-char.sh | 3 +++ tests/03-char-range.in | 9 +++++++++ tests/03-char-range.out | 6 ++++++ tests/03-char-range.sh | 3 +++ tests/04-sequence.in | 4 ++++ tests/04-sequence.out | 1 + tests/04-sequence.sh | 5 +++++ tests/05-dot.in | 6 ++++++ tests/05-dot.out | 2 ++ tests/05-dot.sh | 3 +++ tests/06-start-of-line.in | 5 +++++ tests/06-start-of-line.out | 2 ++ tests/06-start-of-line.sh | 3 +++ tests/07-end-of-line.in | 4 ++++ tests/07-end-of-line.out | 2 ++ tests/07-end-of-line.sh | 3 +++ tests/08-spaces.in | 6 ++++++ tests/08-spaces.out | 4 ++++ tests/08-spaces.sh | 3 +++ tests/09-ellipsis.in | 6 ++++++ tests/09-ellipsis.out | 3 +++ tests/09-ellipsis.sh | 3 +++ tests/1-literal.in | 5 ----- tests/1-literal.out | 2 -- tests/1-literal.sh | 3 --- tests/2-char.in | 5 ----- tests/2-char.out | 3 --- tests/2-char.sh | 3 --- tests/3-char-range.in | 9 --------- tests/3-char-range.out | 6 ------ tests/3-char-range.sh | 3 --- tests/4-sequence.in | 4 ---- tests/4-sequence.out | 1 - tests/4-sequence.sh | 5 ----- tests/5-dot.in | 6 ------ tests/5-dot.out | 2 -- tests/5-dot.sh | 3 --- tests/6-start-of-line.in | 5 ----- tests/6-start-of-line.out | 2 -- tests/6-start-of-line.sh | 3 --- tests/7-end-of-line.in | 4 ---- tests/7-end-of-line.out | 2 -- tests/7-end-of-line.sh | 3 --- tests/8-spaces.in | 6 ------ tests/8-spaces.out | 4 ---- tests/8-spaces.sh | 3 --- tests/9-ellipsis.in | 6 ------ tests/9-ellipsis.out | 3 --- tests/9-ellipsis.sh | 3 --- 54 files changed, 104 insertions(+), 104 deletions(-) create mode 100644 tests/01-literal.in create mode 100644 tests/01-literal.out create mode 100644 tests/01-literal.sh create mode 100644 tests/02-char.in create mode 100644 tests/02-char.out create mode 100644 tests/02-char.sh create mode 100644 tests/03-char-range.in create mode 100644 tests/03-char-range.out create mode 100644 tests/03-char-range.sh create mode 100644 tests/04-sequence.in create mode 100644 tests/04-sequence.out create mode 100644 tests/04-sequence.sh create mode 100644 tests/05-dot.in create mode 100644 tests/05-dot.out create mode 100644 tests/05-dot.sh create mode 100644 tests/06-start-of-line.in create mode 100644 tests/06-start-of-line.out create mode 100644 tests/06-start-of-line.sh create mode 100644 tests/07-end-of-line.in create mode 100644 tests/07-end-of-line.out create mode 100644 tests/07-end-of-line.sh create mode 100644 tests/08-spaces.in create mode 100644 tests/08-spaces.out create mode 100644 tests/08-spaces.sh create mode 100644 tests/09-ellipsis.in create mode 100644 tests/09-ellipsis.out create mode 100644 tests/09-ellipsis.sh delete mode 100644 tests/1-literal.in delete mode 100644 tests/1-literal.out delete mode 100644 tests/1-literal.sh delete mode 100644 tests/2-char.in delete mode 100644 tests/2-char.out delete mode 100644 tests/2-char.sh delete mode 100644 tests/3-char-range.in delete mode 100644 tests/3-char-range.out delete mode 100644 tests/3-char-range.sh delete mode 100644 tests/4-sequence.in delete mode 100644 tests/4-sequence.out delete mode 100644 tests/4-sequence.sh delete mode 100644 tests/5-dot.in delete mode 100644 tests/5-dot.out delete mode 100644 tests/5-dot.sh delete mode 100644 tests/6-start-of-line.in delete mode 100644 tests/6-start-of-line.out delete mode 100644 tests/6-start-of-line.sh delete mode 100644 tests/7-end-of-line.in delete mode 100644 tests/7-end-of-line.out delete mode 100644 tests/7-end-of-line.sh delete mode 100644 tests/8-spaces.in delete mode 100644 tests/8-spaces.out delete mode 100644 tests/8-spaces.sh delete mode 100644 tests/9-ellipsis.in delete mode 100644 tests/9-ellipsis.out delete mode 100644 tests/9-ellipsis.sh (limited to 'tests') diff --git a/tests/01-literal.in b/tests/01-literal.in new file mode 100644 index 0000000..80a7210 --- /dev/null +++ b/tests/01-literal.in @@ -0,0 +1,5 @@ +xxx +foo +baz +xxfooxx +zzz diff --git a/tests/01-literal.out b/tests/01-literal.out new file mode 100644 index 0000000..99f2a64 --- /dev/null +++ b/tests/01-literal.out @@ -0,0 +1,2 @@ +foo +xxfooxx diff --git a/tests/01-literal.sh b/tests/01-literal.sh new file mode 100644 index 0000000..618dc4b --- /dev/null +++ b/tests/01-literal.sh @@ -0,0 +1,3 @@ +# Use double quotation marks to match literal strings +# Example: bp -p '"baz"' +bp -p '"foo"' diff --git a/tests/02-char.in b/tests/02-char.in new file mode 100644 index 0000000..516dcd7 --- /dev/null +++ b/tests/02-char.in @@ -0,0 +1,5 @@ +nope +xylophone +not this line +hexagonal +oxen diff --git a/tests/02-char.out b/tests/02-char.out new file mode 100644 index 0000000..d407d07 --- /dev/null +++ b/tests/02-char.out @@ -0,0 +1,3 @@ +xylophone +hexagonal +oxen diff --git a/tests/02-char.sh b/tests/02-char.sh new file mode 100644 index 0000000..e630e45 --- /dev/null +++ b/tests/02-char.sh @@ -0,0 +1,3 @@ +# Match a single character with backtick: +# Example: bp -p '`A' matches the letter "A" +bp -p '`x' diff --git a/tests/03-char-range.in b/tests/03-char-range.in new file mode 100644 index 0000000..ad062db --- /dev/null +++ b/tests/03-char-range.in @@ -0,0 +1,9 @@ +0 +1 +X +2 +! +3 +; +a +f diff --git a/tests/03-char-range.out b/tests/03-char-range.out new file mode 100644 index 0000000..008986c --- /dev/null +++ b/tests/03-char-range.out @@ -0,0 +1,6 @@ +0 +1 +2 +3 +a +f diff --git a/tests/03-char-range.sh b/tests/03-char-range.sh new file mode 100644 index 0000000..7904466 --- /dev/null +++ b/tests/03-char-range.sh @@ -0,0 +1,3 @@ +# Character sets and ranges work with backticks +# Example: bp -p '`a-z,A-Z' matches all lowercase and uppercase letters +bp -p '`0-9,a-f' diff --git a/tests/04-sequence.in b/tests/04-sequence.in new file mode 100644 index 0000000..c39976c --- /dev/null +++ b/tests/04-sequence.in @@ -0,0 +1,4 @@ +onetwo +one +two +xxxx diff --git a/tests/04-sequence.out b/tests/04-sequence.out new file mode 100644 index 0000000..1d202ca --- /dev/null +++ b/tests/04-sequence.out @@ -0,0 +1 @@ +onetwo diff --git a/tests/04-sequence.sh b/tests/04-sequence.sh new file mode 100644 index 0000000..dc61eeb --- /dev/null +++ b/tests/04-sequence.sh @@ -0,0 +1,5 @@ +# Multiple patterns in a row represent a sequence. +# bp pattern syntax mostly doesn't care about whitespace, so you can have +# spaces between patterns if you want, but it's not required. +# Example: bp -p '"foo" `0-9' matches "foo1", "foo2", etc. +bp -p '"one" "two"' diff --git a/tests/05-dot.in b/tests/05-dot.in new file mode 100644 index 0000000..3e16ece --- /dev/null +++ b/tests/05-dot.in @@ -0,0 +1,6 @@ +aX +aY +a +Xa +y +zz diff --git a/tests/05-dot.out b/tests/05-dot.out new file mode 100644 index 0000000..2e1c61d --- /dev/null +++ b/tests/05-dot.out @@ -0,0 +1,2 @@ +aX +aY diff --git a/tests/05-dot.sh b/tests/05-dot.sh new file mode 100644 index 0000000..ec5c9e7 --- /dev/null +++ b/tests/05-dot.sh @@ -0,0 +1,3 @@ +# The dot matches a single character +# Example: bp -p '.' +bp -p '`a .' diff --git a/tests/06-start-of-line.in b/tests/06-start-of-line.in new file mode 100644 index 0000000..fc48028 --- /dev/null +++ b/tests/06-start-of-line.in @@ -0,0 +1,5 @@ +xxxxx +foo +foobar +barfoo +xxfooxx diff --git a/tests/06-start-of-line.out b/tests/06-start-of-line.out new file mode 100644 index 0000000..4f6c252 --- /dev/null +++ b/tests/06-start-of-line.out @@ -0,0 +1,2 @@ +foo +foobar diff --git a/tests/06-start-of-line.sh b/tests/06-start-of-line.sh new file mode 100644 index 0000000..c44000e --- /dev/null +++ b/tests/06-start-of-line.sh @@ -0,0 +1,3 @@ +# ^ matches start of a line +# Example: bp -p '^ "x"' matches lines starting with "x" +bp -p '^ "foo"' diff --git a/tests/07-end-of-line.in b/tests/07-end-of-line.in new file mode 100644 index 0000000..328e2de --- /dev/null +++ b/tests/07-end-of-line.in @@ -0,0 +1,4 @@ +xxxx +foobar +foo +barfoo diff --git a/tests/07-end-of-line.out b/tests/07-end-of-line.out new file mode 100644 index 0000000..419534f --- /dev/null +++ b/tests/07-end-of-line.out @@ -0,0 +1,2 @@ +foo +barfoo diff --git a/tests/07-end-of-line.sh b/tests/07-end-of-line.sh new file mode 100644 index 0000000..4a1e05d --- /dev/null +++ b/tests/07-end-of-line.sh @@ -0,0 +1,3 @@ +# $ matches end of line +# Example: bp -p '"x" $' matches lines ending with "x" +bp -p '"foo" $' diff --git a/tests/08-spaces.in b/tests/08-spaces.in new file mode 100644 index 0000000..8b72b23 --- /dev/null +++ b/tests/08-spaces.in @@ -0,0 +1,6 @@ +onetwo +one two +one two +one two +xxx +one;;;two diff --git a/tests/08-spaces.out b/tests/08-spaces.out new file mode 100644 index 0000000..75dc1e4 --- /dev/null +++ b/tests/08-spaces.out @@ -0,0 +1,4 @@ +onetwo +one two +one two +one two diff --git a/tests/08-spaces.sh b/tests/08-spaces.sh new file mode 100644 index 0000000..cc16d96 --- /dev/null +++ b/tests/08-spaces.sh @@ -0,0 +1,3 @@ +# The _ pattern matches zero or more spaces/tabs +# Example: bp -p '`= _ "foo"' matches "=foo", "= foo", "= foo", etc. +bp -p '"one" _ "two"' diff --git a/tests/09-ellipsis.in b/tests/09-ellipsis.in new file mode 100644 index 0000000..7668caa --- /dev/null +++ b/tests/09-ellipsis.in @@ -0,0 +1,6 @@ +helloworld +hello;;;world +hello1234world +goodbye +hello +helloworxx diff --git a/tests/09-ellipsis.out b/tests/09-ellipsis.out new file mode 100644 index 0000000..f64e0e2 --- /dev/null +++ b/tests/09-ellipsis.out @@ -0,0 +1,3 @@ +helloworld +hello;;;world +hello1234world diff --git a/tests/09-ellipsis.sh b/tests/09-ellipsis.sh new file mode 100644 index 0000000..0763fd1 --- /dev/null +++ b/tests/09-ellipsis.sh @@ -0,0 +1,3 @@ +# The ellipsis matches text upto the following pattern, not counting newlines +# Example: bp -p '"/*" .. "*/"' matches "/* blah blah */" or "/**/" +bp -p '"hello" .. "world"' diff --git a/tests/1-literal.in b/tests/1-literal.in deleted file mode 100644 index 80a7210..0000000 --- a/tests/1-literal.in +++ /dev/null @@ -1,5 +0,0 @@ -xxx -foo -baz -xxfooxx -zzz diff --git a/tests/1-literal.out b/tests/1-literal.out deleted file mode 100644 index 99f2a64..0000000 --- a/tests/1-literal.out +++ /dev/null @@ -1,2 +0,0 @@ -foo -xxfooxx diff --git a/tests/1-literal.sh b/tests/1-literal.sh deleted file mode 100644 index 618dc4b..0000000 --- a/tests/1-literal.sh +++ /dev/null @@ -1,3 +0,0 @@ -# Use double quotation marks to match literal strings -# Example: bp -p '"baz"' -bp -p '"foo"' diff --git a/tests/2-char.in b/tests/2-char.in deleted file mode 100644 index 516dcd7..0000000 --- a/tests/2-char.in +++ /dev/null @@ -1,5 +0,0 @@ -nope -xylophone -not this line -hexagonal -oxen diff --git a/tests/2-char.out b/tests/2-char.out deleted file mode 100644 index d407d07..0000000 --- a/tests/2-char.out +++ /dev/null @@ -1,3 +0,0 @@ -xylophone -hexagonal -oxen diff --git a/tests/2-char.sh b/tests/2-char.sh deleted file mode 100644 index e630e45..0000000 --- a/tests/2-char.sh +++ /dev/null @@ -1,3 +0,0 @@ -# Match a single character with backtick: -# Example: bp -p '`A' matches the letter "A" -bp -p '`x' diff --git a/tests/3-char-range.in b/tests/3-char-range.in deleted file mode 100644 index ad062db..0000000 --- a/tests/3-char-range.in +++ /dev/null @@ -1,9 +0,0 @@ -0 -1 -X -2 -! -3 -; -a -f diff --git a/tests/3-char-range.out b/tests/3-char-range.out deleted file mode 100644 index 008986c..0000000 --- a/tests/3-char-range.out +++ /dev/null @@ -1,6 +0,0 @@ -0 -1 -2 -3 -a -f diff --git a/tests/3-char-range.sh b/tests/3-char-range.sh deleted file mode 100644 index 7904466..0000000 --- a/tests/3-char-range.sh +++ /dev/null @@ -1,3 +0,0 @@ -# Character sets and ranges work with backticks -# Example: bp -p '`a-z,A-Z' matches all lowercase and uppercase letters -bp -p '`0-9,a-f' diff --git a/tests/4-sequence.in b/tests/4-sequence.in deleted file mode 100644 index c39976c..0000000 --- a/tests/4-sequence.in +++ /dev/null @@ -1,4 +0,0 @@ -onetwo -one -two -xxxx diff --git a/tests/4-sequence.out b/tests/4-sequence.out deleted file mode 100644 index 1d202ca..0000000 --- a/tests/4-sequence.out +++ /dev/null @@ -1 +0,0 @@ -onetwo diff --git a/tests/4-sequence.sh b/tests/4-sequence.sh deleted file mode 100644 index dc61eeb..0000000 --- a/tests/4-sequence.sh +++ /dev/null @@ -1,5 +0,0 @@ -# Multiple patterns in a row represent a sequence. -# bp pattern syntax mostly doesn't care about whitespace, so you can have -# spaces between patterns if you want, but it's not required. -# Example: bp -p '"foo" `0-9' matches "foo1", "foo2", etc. -bp -p '"one" "two"' diff --git a/tests/5-dot.in b/tests/5-dot.in deleted file mode 100644 index 3e16ece..0000000 --- a/tests/5-dot.in +++ /dev/null @@ -1,6 +0,0 @@ -aX -aY -a -Xa -y -zz diff --git a/tests/5-dot.out b/tests/5-dot.out deleted file mode 100644 index 2e1c61d..0000000 --- a/tests/5-dot.out +++ /dev/null @@ -1,2 +0,0 @@ -aX -aY diff --git a/tests/5-dot.sh b/tests/5-dot.sh deleted file mode 100644 index ec5c9e7..0000000 --- a/tests/5-dot.sh +++ /dev/null @@ -1,3 +0,0 @@ -# The dot matches a single character -# Example: bp -p '.' -bp -p '`a .' diff --git a/tests/6-start-of-line.in b/tests/6-start-of-line.in deleted file mode 100644 index fc48028..0000000 --- a/tests/6-start-of-line.in +++ /dev/null @@ -1,5 +0,0 @@ -xxxxx -foo -foobar -barfoo -xxfooxx diff --git a/tests/6-start-of-line.out b/tests/6-start-of-line.out deleted file mode 100644 index 4f6c252..0000000 --- a/tests/6-start-of-line.out +++ /dev/null @@ -1,2 +0,0 @@ -foo -foobar diff --git a/tests/6-start-of-line.sh b/tests/6-start-of-line.sh deleted file mode 100644 index c44000e..0000000 --- a/tests/6-start-of-line.sh +++ /dev/null @@ -1,3 +0,0 @@ -# ^ matches start of a line -# Example: bp -p '^ "x"' matches lines starting with "x" -bp -p '^ "foo"' diff --git a/tests/7-end-of-line.in b/tests/7-end-of-line.in deleted file mode 100644 index 328e2de..0000000 --- a/tests/7-end-of-line.in +++ /dev/null @@ -1,4 +0,0 @@ -xxxx -foobar -foo -barfoo diff --git a/tests/7-end-of-line.out b/tests/7-end-of-line.out deleted file mode 100644 index 419534f..0000000 --- a/tests/7-end-of-line.out +++ /dev/null @@ -1,2 +0,0 @@ -foo -barfoo diff --git a/tests/7-end-of-line.sh b/tests/7-end-of-line.sh deleted file mode 100644 index 4a1e05d..0000000 --- a/tests/7-end-of-line.sh +++ /dev/null @@ -1,3 +0,0 @@ -# $ matches end of line -# Example: bp -p '"x" $' matches lines ending with "x" -bp -p '"foo" $' diff --git a/tests/8-spaces.in b/tests/8-spaces.in deleted file mode 100644 index 8b72b23..0000000 --- a/tests/8-spaces.in +++ /dev/null @@ -1,6 +0,0 @@ -onetwo -one two -one two -one two -xxx -one;;;two diff --git a/tests/8-spaces.out b/tests/8-spaces.out deleted file mode 100644 index 75dc1e4..0000000 --- a/tests/8-spaces.out +++ /dev/null @@ -1,4 +0,0 @@ -onetwo -one two -one two -one two diff --git a/tests/8-spaces.sh b/tests/8-spaces.sh deleted file mode 100644 index cc16d96..0000000 --- a/tests/8-spaces.sh +++ /dev/null @@ -1,3 +0,0 @@ -# The _ pattern matches zero or more spaces/tabs -# Example: bp -p '`= _ "foo"' matches "=foo", "= foo", "= foo", etc. -bp -p '"one" _ "two"' diff --git a/tests/9-ellipsis.in b/tests/9-ellipsis.in deleted file mode 100644 index 7668caa..0000000 --- a/tests/9-ellipsis.in +++ /dev/null @@ -1,6 +0,0 @@ -helloworld -hello;;;world -hello1234world -goodbye -hello -helloworxx diff --git a/tests/9-ellipsis.out b/tests/9-ellipsis.out deleted file mode 100644 index f64e0e2..0000000 --- a/tests/9-ellipsis.out +++ /dev/null @@ -1,3 +0,0 @@ -helloworld -hello;;;world -hello1234world diff --git a/tests/9-ellipsis.sh b/tests/9-ellipsis.sh deleted file mode 100644 index 0763fd1..0000000 --- a/tests/9-ellipsis.sh +++ /dev/null @@ -1,3 +0,0 @@ -# The ellipsis matches text upto the following pattern, not counting newlines -# Example: bp -p '"/*" .. "*/"' matches "/* blah blah */" or "/**/" -bp -p '"hello" .. "world"' -- cgit v1.2.3