From 8732213db41e4d080651f85b0e6fcee1ebacf612 Mon Sep 17 00:00:00 2001 From: Norbert Buchmueller Date: Tue, 17 Apr 2018 00:10:34 +0200 Subject: Add tests and documentation of passing options to grep(1) --- tests/t0400-grep.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/t0400-grep.sh b/tests/t0400-grep.sh index 206377f..b244cf4 100755 --- a/tests/t0400-grep.sh +++ b/tests/t0400-grep.sh @@ -18,4 +18,16 @@ test_expect_success 'Make sure grep prints normal lines' ' grep -q "They are" <<<"$results" ' +test_expect_success 'Test passing the "-i" option to grep' ' + "$PASS" init $KEY1 && + "$PASS" insert -e blah1 <<<"I wonder..." && + "$PASS" insert -e blah2 <<<"Will it ignore" && + "$PASS" insert -e blah3 <<<"case when searching?" && + "$PASS" insert -e folder/blah4 <<<"Yes, it does. Wonderful!" && + results="$("$PASS" grep -i wonder)" && + [[ $(wc -l <<<"$results") -eq 4 ]] && + grep -q blah1 <<<"$results" && + grep -q blah4 <<<"$results" +' + test_done -- cgit v1.2.3