Skip to content
Snippets Groups Projects
Commit 73bc368c authored by an7s's avatar an7s
Browse files

regressions for grep

Former-commit-id: 2ac661a0ada3d7260e86bfca523081a3baf874b3
parent f124c1c2
No related branches found
No related tags found
No related merge requests found
......@@ -119,6 +119,11 @@ stock_examples/xpdfsrc.stock -text
tests/bzip/data/compression_input1 -text
tests/bzip/data/decompression_input1 -text
tests/bzip/test_script.sh -text
tests/grep/data/data1.txt -text
tests/grep/data/data2.txt -text
tests/grep/data/pattern -text
tests/grep/data/pattern2 -text
tests/grep/test_script.sh -text
tests/manual_test_lib.sh -text
tests/touch/test_script.sh -text
tools/bed.sh -text
......
<html>
<body>
Hello
The quick brown fox jumps over the lazy dog
My name is Bond, James Bond
</body>
</html>
128.27.42.23
22324143
341324 3124
13241234148888
cool
col
cccccccccccc
91-1234567890
We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.
That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient causes; and accordingly all experience hath shewn, that mankind are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms to which they are accustomed. But when a long train of abuses and usurpations, pursuing invariably the same Object evinces a design to reduce them under absolute Despotism, it is their right, it is their duty, to throw off such Government, and to provide new Guards for their future security.
.*the.*$
.*the.*$
^(t|T)he.*[Qq]
(d|D).*(g|G)$
#!/bin/bash
#Everyone must point to the manual test library
TEST_LIB=$PEASOUP_HOME/tests/manual_test_lib.sh
#for bzip, I use some data files, so I set up variables pointing to that location
TEST_DIR=$PEASOUP_HOME/tests/grep
DATA_DIR=$TEST_DIR/data
#used for filtering program names from output.
ORIG_NAME=grep
#must import the library here, as it depends on some of the above variables
. $TEST_LIB
#run_basic_test will run both the modified program and original program using the same arguments. The first argument ot run_basic_test is the timeout value (in seconds) followed by the arguments for the programs. run_basic_test also does comparisons of stdout, stderr, and the exit status, and only does comparisons and uses timeout when the -i flag is not set. See the library for more details.
run_basic_test 120 --help
run_basic_test 120 --version
run_basic_test 120 -i -U -B 1 -A 2 brown $DATA_DIR/data1.txt
run_basic_test 120 fox $DATA_DIR/data1.txt
run_basic_test 120 --text -vn Fox $DATA_DIR/data1.txt $DATA_DIR/data2.txt
run_basic_test 120 -iw the $DATA_DIR/data1.txt $DATA_DIR/data2.txt
run_basic_test 120 -RTo --line-buffered the $DATA_DIR
run_basic_test 120 -il pursuit $DATA_DIR/data1.txt $DATA_DIR/data2.txt
run_basic_test 120 --line-buffered -iL pursuit $DATA_DIR/data1.txt $DATA_DIR/data2.txt
run_basic_test 120 -hR "over.*" $DATA_DIR
run_basic_test 120 -i "over.*" $DATA_DIR/data1.txt
run_basic_test 120 -i -q ".*over.*" $DATA_DIR/data1.txt
run_basic_test 120 -i -s ".*over.*" $DATA_DIR/data1.txt
run_basic_test 120 --binary -i -w "over" $DATA_DIR/data1.txt
run_basic_test 120 -i --line-number ".*dog.*$" $DATA_DIR/data1.txt
run_basic_test 120 -i "^the.*" $DATA_DIR/data1.txt
run_basic_test 120 -E "^[a-z,0-9,F-Z]+" $DATA_DIR/data1.txt
run_basic_test 120 -E "(T|t)he*(q|x)uick*" $DATA_DIR/data1.txt
run_basic_test 120 -U -w -i -c --context=3 "lazy dog" $DATA_DIR/data1.txt
run_basic_test 120 -f $DATA_DIR/pattern $DATA_DIR/data1.txt
run_basic_test 120 -i -n -f $DATA_DIR/pattern2 $DATA_DIR/data1.txt
run_basic_test 120 --color -ivn "^the.*" $DATA_DIR/data1.txt
run_basic_test 120 "[:alnum:]" $DATA_DIR/data1.txt
run_basic_test 120 "[:alpha:]" $DATA_DIR/data1.txt
run_basic_test 120 "[:digit:]" $DATA_DIR/data1.txt
run_basic_test 120 "[:lower:]" $DATA_DIR/data1.txt
run_basic_test 120 "[:space:]" $DATA_DIR/data1.txt
run_basic_test 120 "[:upper:]" $DATA_DIR/data1.txt
run_basic_test 120 "\<b...n\>" $DATA_DIR/data1.txt
run_basic_test 120 "^\.[0-9]" $DATA_DIR/data1.txt
run_basic_test 120 -E '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' $DATA_DIR/data1.txt
run_basic_test 120 -E '2{2}' $DATA_DIR/data1.txt
run_basic_test 120 -E 'h{1}' $DATA_DIR/data1.txt
run_basic_test 120 -E 'co{1,2}l' $DATA_DIR/data1.txt
run_basic_test 120 -E 'c{3,}' $DATA_DIR/data1.txt
run_basic_test 120 -v -E "[[:digit:]]\{2\}[ -]\?[[:digit:]]\{10\}" $DATA_DIR/data1.txt
run_basic_test 120 -E "[[:digit:]]\{2\}[ -]\?[[:digit:]]\{10\}" $DATA_DIR/data1.txt
#Ben, for some reason this one doesn't work even when I run the original grep against itself
#run_basic_test 120 -E "[a-z]*" $DATA_DIR/data1.txt
cleanup
report_success
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment