m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNorbert Buchmueller <norbi@nix.hu>2018-04-17 00:10:34 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-14 16:58:28 +0200
commit8732213db41e4d080651f85b0e6fcee1ebacf612 (patch)
tree37633f945de8924acd07101738e5681aab24bfca /tests
parent8683403b77f59c56fcb1f05c61ab33b9fd61a30d (diff)
Add tests and documentation of passing options to grep(1)
Diffstat (limited to 'tests')
-rwxr-xr-xtests/t0400-grep.sh12
1 files changed, 12 insertions, 0 deletions
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