grep tests; slight tweak to tester
This commit is contained in:
11
initial-utilities/wgrep/test-wgrep.sh
Executable file
11
initial-utilities/wgrep/test-wgrep.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#! /bin/bash
|
||||
|
||||
if ! [[ -x wgrep ]]; then
|
||||
echo "wgrep executable does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
../../tester/run-tests.sh $*
|
||||
|
||||
|
||||
|
||||
1
initial-utilities/wgrep/tests/1.desc
Normal file
1
initial-utilities/wgrep/tests/1.desc
Normal file
@@ -0,0 +1 @@
|
||||
simple test - find one line out of three in the file
|
||||
0
initial-utilities/wgrep/tests/1.err
Normal file
0
initial-utilities/wgrep/tests/1.err
Normal file
3
initial-utilities/wgrep/tests/1.in
Normal file
3
initial-utilities/wgrep/tests/1.in
Normal file
@@ -0,0 +1,3 @@
|
||||
a simple test of grep
|
||||
which includes this line to find
|
||||
and some other lines
|
||||
1
initial-utilities/wgrep/tests/1.out
Normal file
1
initial-utilities/wgrep/tests/1.out
Normal file
@@ -0,0 +1 @@
|
||||
which includes this line to find
|
||||
1
initial-utilities/wgrep/tests/1.rc
Normal file
1
initial-utilities/wgrep/tests/1.rc
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
initial-utilities/wgrep/tests/1.run
Normal file
1
initial-utilities/wgrep/tests/1.run
Normal file
@@ -0,0 +1 @@
|
||||
./wgrep this tests/1.in
|
||||
1
initial-utilities/wgrep/tests/2.desc
Normal file
1
initial-utilities/wgrep/tests/2.desc
Normal file
@@ -0,0 +1 @@
|
||||
file does not exist
|
||||
0
initial-utilities/wgrep/tests/2.err
Normal file
0
initial-utilities/wgrep/tests/2.err
Normal file
1
initial-utilities/wgrep/tests/2.out
Normal file
1
initial-utilities/wgrep/tests/2.out
Normal file
@@ -0,0 +1 @@
|
||||
wgrep: cannot open file
|
||||
1
initial-utilities/wgrep/tests/2.rc
Normal file
1
initial-utilities/wgrep/tests/2.rc
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
1
initial-utilities/wgrep/tests/2.run
Normal file
1
initial-utilities/wgrep/tests/2.run
Normal file
@@ -0,0 +1 @@
|
||||
./wgrep this tests/2.in
|
||||
1
initial-utilities/wgrep/tests/3.desc
Normal file
1
initial-utilities/wgrep/tests/3.desc
Normal file
@@ -0,0 +1 @@
|
||||
too few command-line arguments (zero)
|
||||
0
initial-utilities/wgrep/tests/3.err
Normal file
0
initial-utilities/wgrep/tests/3.err
Normal file
1
initial-utilities/wgrep/tests/3.out
Normal file
1
initial-utilities/wgrep/tests/3.out
Normal file
@@ -0,0 +1 @@
|
||||
wgrep: searchterm [file ...]
|
||||
1
initial-utilities/wgrep/tests/3.rc
Normal file
1
initial-utilities/wgrep/tests/3.rc
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
1
initial-utilities/wgrep/tests/3.run
Normal file
1
initial-utilities/wgrep/tests/3.run
Normal file
@@ -0,0 +1 @@
|
||||
./wgrep
|
||||
1
initial-utilities/wgrep/tests/4.desc
Normal file
1
initial-utilities/wgrep/tests/4.desc
Normal file
@@ -0,0 +1 @@
|
||||
standard input test
|
||||
0
initial-utilities/wgrep/tests/4.err
Normal file
0
initial-utilities/wgrep/tests/4.err
Normal file
5
initial-utilities/wgrep/tests/4.in
Normal file
5
initial-utilities/wgrep/tests/4.in
Normal file
@@ -0,0 +1,5 @@
|
||||
this is a test of standard input
|
||||
you should see this line in the output because it has words in it
|
||||
this line also has words
|
||||
but this one doesnt
|
||||
nor does this one
|
||||
2
initial-utilities/wgrep/tests/4.out
Normal file
2
initial-utilities/wgrep/tests/4.out
Normal file
@@ -0,0 +1,2 @@
|
||||
you should see this line in the output because it has words in it
|
||||
this line also has words
|
||||
1
initial-utilities/wgrep/tests/4.rc
Normal file
1
initial-utilities/wgrep/tests/4.rc
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
initial-utilities/wgrep/tests/4.run
Normal file
1
initial-utilities/wgrep/tests/4.run
Normal file
@@ -0,0 +1 @@
|
||||
cat tests/4.in | ./wgrep words
|
||||
1
initial-utilities/wgrep/tests/4.stdin
Normal file
1
initial-utilities/wgrep/tests/4.stdin
Normal file
@@ -0,0 +1 @@
|
||||
INPUT_DIR/4.in
|
||||
1
initial-utilities/wgrep/tests/5.desc
Normal file
1
initial-utilities/wgrep/tests/5.desc
Normal file
@@ -0,0 +1 @@
|
||||
long search term
|
||||
0
initial-utilities/wgrep/tests/5.err
Normal file
0
initial-utilities/wgrep/tests/5.err
Normal file
12
initial-utilities/wgrep/tests/5.in
Normal file
12
initial-utilities/wgrep/tests/5.in
Normal file
@@ -0,0 +1,12 @@
|
||||
long line test is here
|
||||
the string alksdjfhalskdfhjasdlkfjhadslkfjhasdlkfjhasdlkfjhasdlkfjhdaslkfjhadslkfjhasdlkfjhadslkfjhdsalkjfhsadlkjfh should be found
|
||||
but not alksdjfhalskdfhjasdlkfjhadslkfjhasdlkfjhasdlkfjhasdlkfjhdaslkfjhadslkfjhasdlkfjhadslk
|
||||
or fjhdsalkjfhsadlkjfh
|
||||
or alksdjfhalskdfhjasdlkfjhadslkfjhasdlkfjhasdlkfjhasd
|
||||
ok?
|
||||
|
||||
|
||||
|
||||
but also alksdjfhalskdfhjasdlkfjhadslkfjhasdlkfjhasdlkfjhasdlkfjhdaslkfjhadslkfjhasdlkfjhadslkfjhdsalkjfhsadlkjfh should be found
|
||||
ok too?
|
||||
|
||||
2
initial-utilities/wgrep/tests/5.out
Normal file
2
initial-utilities/wgrep/tests/5.out
Normal file
@@ -0,0 +1,2 @@
|
||||
the string alksdjfhalskdfhjasdlkfjhadslkfjhasdlkfjhasdlkfjhasdlkfjhdaslkfjhadslkfjhasdlkfjhadslkfjhdsalkjfhsadlkjfh should be found
|
||||
but also alksdjfhalskdfhjasdlkfjhadslkfjhasdlkfjhasdlkfjhasdlkfjhdaslkfjhadslkfjhasdlkfjhadslkfjhdsalkjfhsadlkjfh should be found
|
||||
1
initial-utilities/wgrep/tests/5.rc
Normal file
1
initial-utilities/wgrep/tests/5.rc
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
2
initial-utilities/wgrep/tests/5.run
Normal file
2
initial-utilities/wgrep/tests/5.run
Normal file
@@ -0,0 +1,2 @@
|
||||
./wgrep alksdjfhalskdfhjasdlkfjhadslkfjhasdlkfjhasdlkfjhasdlkfjhdaslkfjhadslkfjhasdlkfjhadslkfjhdsalkjfhsadlkjfh tests/5.in
|
||||
|
||||
1
initial-utilities/wgrep/tests/6.desc
Normal file
1
initial-utilities/wgrep/tests/6.desc
Normal file
@@ -0,0 +1 @@
|
||||
long lines of text
|
||||
0
initial-utilities/wgrep/tests/6.err
Normal file
0
initial-utilities/wgrep/tests/6.err
Normal file
8
initial-utilities/wgrep/tests/6.in
Normal file
8
initial-utilities/wgrep/tests/6.in
Normal file
File diff suppressed because one or more lines are too long
4
initial-utilities/wgrep/tests/6.out
Normal file
4
initial-utilities/wgrep/tests/6.out
Normal file
File diff suppressed because one or more lines are too long
1
initial-utilities/wgrep/tests/6.rc
Normal file
1
initial-utilities/wgrep/tests/6.rc
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
initial-utilities/wgrep/tests/6.run
Normal file
1
initial-utilities/wgrep/tests/6.run
Normal file
@@ -0,0 +1 @@
|
||||
./wgrep very tests/6.in
|
||||
1
initial-utilities/wgrep/tests/7.desc
Normal file
1
initial-utilities/wgrep/tests/7.desc
Normal file
@@ -0,0 +1 @@
|
||||
long file test (with few matches)
|
||||
0
initial-utilities/wgrep/tests/7.err
Normal file
0
initial-utilities/wgrep/tests/7.err
Normal file
1000000
initial-utilities/wgrep/tests/7.in
Normal file
1000000
initial-utilities/wgrep/tests/7.in
Normal file
File diff suppressed because it is too large
Load Diff
6
initial-utilities/wgrep/tests/7.out
Normal file
6
initial-utilities/wgrep/tests/7.out
Normal file
@@ -0,0 +1,6 @@
|
||||
EcbjzrykcvSqgwXlblqAcnzlWxDFxztTabuphwMd
|
||||
slXYpvWLacidabup QqCHliLfJROTsdsTRGRecow
|
||||
uyGhFHVebFqRDGsYeQEbbQgRBabupUZTZYRqNSvN
|
||||
GVgCgAanjphabupSaBLddzroaShgDddKWmrqwMee
|
||||
iVLErLVbGAj vXecwVDkxsFtPzZPnOEKVFzqabup
|
||||
QXZDhBUfvKvDBAOQtHUQKYjabupNnNKaeRi bJuU
|
||||
1
initial-utilities/wgrep/tests/7.rc
Normal file
1
initial-utilities/wgrep/tests/7.rc
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
initial-utilities/wgrep/tests/7.run
Normal file
1
initial-utilities/wgrep/tests/7.run
Normal file
@@ -0,0 +1 @@
|
||||
./wgrep abup tests/7.in
|
||||
@@ -3,8 +3,7 @@
|
||||
# run_test testnumber
|
||||
run_test () {
|
||||
testfile=tests/$1.run
|
||||
# cat $testfile
|
||||
$(cat $testfile) > tests-out/$1.out 2> tests-out/$1.err
|
||||
eval $(cat $testfile) > tests-out/$1.out 2> tests-out/$1.err
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user