From: Simon Ruderich Date: Wed, 17 Oct 2012 23:19:59 +0000 (+0200) Subject: t: Add another test. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=eea3b32e72174023716ecbbd3c4d627091dfdb2f;p=config%2Fdotfiles.git t: Add another test. Shows one problem of words-nonword. --- diff --git a/t/expected-empty.txt b/t/expected-empty.txt index 3440328..19c91bf 100644 --- a/t/expected-empty.txt +++ b/t/expected-empty.txt @@ -1,7 +1,7 @@ diff --git a/test.txt b/test.txt --- a/test.txt +++ b/test.txt -@@ -1,21 +1,22 @@ +@@ -1,26 +1,27 @@ Tests ==== @@ -24,3 +24,8 @@ function testme() { } } return 42; +} + +allow = $0 $! $? $. +allow = $! $? +allow = $0 $! $? diff --git a/t/expected-nonspaces.txt b/t/expected-nonspaces.txt index 4a86a16..d6b3558 100644 --- a/t/expected-nonspaces.txt +++ b/t/expected-nonspaces.txt @@ -1,7 +1,7 @@ diff --git a/test.txt b/test.txt --- a/test.txt +++ b/test.txt -@@ -1,21 +1,22 @@ +@@ -1,26 +1,27 @@ Tests [-=====-]{+====+} @@ -25,3 +25,8 @@ function testme() { } } return 42; +} + +allow = {+$0+} $! $? $. +allow = $! $?[-$.-] +allow = {+$0+} $! $?[-$.-] diff --git a/t/expected-word-nonword.txt b/t/expected-word-nonword.txt index 5c60650..76b34ac 100644 --- a/t/expected-word-nonword.txt +++ b/t/expected-word-nonword.txt @@ -1,7 +1,7 @@ diff --git a/test.txt b/test.txt --- a/test.txt +++ b/test.txt -@@ -1,21 +1,22 @@ +@@ -1,26 +1,27 @@ Tests ====[-=-] @@ -24,3 +24,8 @@ function testme() { } } return 42; +} + +allow = ${+0 $+}! $? $. +allow = $! $?[- $.-] +allow = $[-!-]{+0+} $[-?-]{+!+} $[-.-]{+?+} diff --git a/t/expected-words-nonword.txt b/t/expected-words-nonword.txt index 7bae7ed..5e0f6b1 100644 --- a/t/expected-words-nonword.txt +++ b/t/expected-words-nonword.txt @@ -1,7 +1,7 @@ diff --git a/test.txt b/test.txt --- a/test.txt +++ b/test.txt -@@ -1,21 +1,22 @@ +@@ -1,26 +1,27 @@ Tests ====[-=-] @@ -24,3 +24,8 @@ function testme() { } } return 42; +} + +allow = ${+0 $+}! $? $. +allow = $! $?[- $.-] +allow = $[-!-]{+0+} $[-?-]{+!+} $[-.-]{+?+} diff --git a/t/expected-words-nonwords-spaces.txt b/t/expected-words-nonwords-spaces.txt index 4ac431c..cbc70dc 100644 --- a/t/expected-words-nonwords-spaces.txt +++ b/t/expected-words-nonwords-spaces.txt @@ -1,7 +1,7 @@ diff --git a/test.txt b/test.txt --- a/test.txt +++ b/test.txt -@@ -1,21 +1,22 @@ +@@ -1,26 +1,27 @@ Tests [-=====-]{+====+} @@ -24,3 +24,8 @@ function testme() { } } return 42; +} + +allow[- = $! $? $.-]{+ = $0 $! $? $.+} +allow[- = $! $? $.-]{+ = $! $?+} +allow[- = $! $? $.-]{+ = $0 $! $?+} diff --git a/t/expected-words-nonwords.txt b/t/expected-words-nonwords.txt index 4ac431c..cbc70dc 100644 --- a/t/expected-words-nonwords.txt +++ b/t/expected-words-nonwords.txt @@ -1,7 +1,7 @@ diff --git a/test.txt b/test.txt --- a/test.txt +++ b/test.txt -@@ -1,21 +1,22 @@ +@@ -1,26 +1,27 @@ Tests [-=====-]{+====+} @@ -24,3 +24,8 @@ function testme() { } } return 42; +} + +allow[- = $! $? $.-]{+ = $0 $! $? $.+} +allow[- = $! $? $.-]{+ = $! $?+} +allow[- = $! $? $.-]{+ = $0 $! $?+} diff --git a/t/expected-words-nonwordspaces-spaces.txt b/t/expected-words-nonwordspaces-spaces.txt index 0606ad5..11769da 100644 --- a/t/expected-words-nonwordspaces-spaces.txt +++ b/t/expected-words-nonwordspaces-spaces.txt @@ -1,7 +1,7 @@ diff --git a/test.txt b/test.txt --- a/test.txt +++ b/test.txt -@@ -1,21 +1,22 @@ +@@ -1,26 +1,27 @@ Tests [-=====-]{+====+} @@ -24,3 +24,8 @@ function testme() { } } return 42; +} + +allow = {+$0 +}$! $? $. +allow = $! $?[- $.-] +allow = {+$0 +}$! $?[- $.-] diff --git a/t/expected-words-nonwordspaces.txt b/t/expected-words-nonwordspaces.txt index 6d80450..ce5d927 100644 --- a/t/expected-words-nonwordspaces.txt +++ b/t/expected-words-nonwordspaces.txt @@ -1,7 +1,7 @@ diff --git a/test.txt b/test.txt --- a/test.txt +++ b/test.txt -@@ -1,21 +1,22 @@ +@@ -1,26 +1,27 @@ Tests [-=====-]{+====+} @@ -24,3 +24,8 @@ function testme() { } } return 42; +} + +allow = {+$0+} $! $? $. +allow = $! $?[-$.-] +allow = {+$0+} $! $?[-$.-] diff --git a/t/test.sh b/t/test.sh index aedbff0..81e3b12 100755 --- a/t/test.sh +++ b/t/test.sh @@ -55,6 +55,10 @@ function testme() { } return 42; } + +allow = \$! \$? \$. +allow = \$! \$? \$. +allow = \$! \$? \$. EOF git add test.txt git commit -m 'Initial commit.' > /dev/null @@ -83,6 +87,10 @@ function testme() { } return 42; } + +allow = \$0 \$! \$? \$. +allow = \$! \$? +allow = \$0 \$! \$? EOF