grep tests; slight tweak to tester

This commit is contained in:
Remzi Arpaci-Dusseau
2019-02-15 14:13:15 -06:00
parent ae105d7929
commit aaa4f45784
43 changed files with 1000080 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
#! /bin/bash
if ! [[ -x wgrep ]]; then
echo "wgrep executable does not exist"
exit 1
fi
../../tester/run-tests.sh $*

View File

@@ -0,0 +1 @@
simple test - find one line out of three in the file

View File

View File

@@ -0,0 +1,3 @@
a simple test of grep
which includes this line to find
and some other lines

View File

@@ -0,0 +1 @@
which includes this line to find

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wgrep this tests/1.in

View File

@@ -0,0 +1 @@
file does not exist

View File

View File

@@ -0,0 +1 @@
wgrep: cannot open file

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1 @@
./wgrep this tests/2.in

View File

@@ -0,0 +1 @@
too few command-line arguments (zero)

View File

View File

@@ -0,0 +1 @@
wgrep: searchterm [file ...]

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1 @@
./wgrep

View File

@@ -0,0 +1 @@
standard input test

View File

View 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

View File

@@ -0,0 +1,2 @@
you should see this line in the output because it has words in it
this line also has words

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
cat tests/4.in | ./wgrep words

View File

@@ -0,0 +1 @@
INPUT_DIR/4.in

View File

@@ -0,0 +1 @@
long search term

View File

View 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?

View File

@@ -0,0 +1,2 @@
the string alksdjfhalskdfhjasdlkfjhadslkfjhasdlkfjhasdlkfjhasdlkfjhdaslkfjhadslkfjhasdlkfjhadslkfjhdsalkjfhsadlkjfh should be found
but also alksdjfhalskdfhjasdlkfjhadslkfjhasdlkfjhasdlkfjhasdlkfjhdaslkfjhadslkfjhasdlkfjhadslkfjhdsalkjfhsadlkjfh should be found

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1,2 @@
./wgrep alksdjfhalskdfhjasdlkfjhadslkfjhasdlkfjhasdlkfjhasdlkfjhdaslkfjhadslkfjhasdlkfjhadslkfjhdsalkjfhsadlkjfh tests/5.in

View File

@@ -0,0 +1 @@
long lines of text

View File

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wgrep very tests/6.in

View File

@@ -0,0 +1 @@
long file test (with few matches)

View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
EcbjzrykcvSqgwXlblqAcnzlWxDFxztTabuphwMd
slXYpvWLacidabup QqCHliLfJROTsdsTRGRecow
uyGhFHVebFqRDGsYeQEbbQgRBabupUZTZYRqNSvN
GVgCgAanjphabupSaBLddzroaShgDddKWmrqwMee
iVLErLVbGAj vXecwVDkxsFtPzZPnOEKVFzqabup
QXZDhBUfvKvDBAOQtHUQKYjabupNnNKaeRi bJuU

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wgrep abup tests/7.in

View File

@@ -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
}