summaryrefslogtreecommitdiff
path: root/tests/t0400-grep.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtests/t0400-grep.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/t0400-grep.sh b/tests/t0400-grep.sh
new file mode 100755
index 0000000..0c55cf8
--- /dev/null
+++ b/tests/t0400-grep.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+test_description='Grep check'
+. ./setup.sh
+
+test_expect_success 'Make sure grep prints normal lines' '
+ pass init $KEY1 &&
+ pass insert -e blah1 <<<"hello" &&
+ pass insert -e blah2 <<<"my name is" &&
+ pass insert -e folder/blah3 <<<"I hate computers" &&
+ pass insert -e blah4 <<<"me too!" &&
+ pass insert -e folder/where/blah5 <<<"They are hell" &&
+ results="$(pass grep hell)" &&
+ [[ $(wc -l <<<"$results") -eq 4 ]] &&
+ grep -q blah5 <<<"$results" &&
+ grep -q blah1 <<<"$results" &&
+ grep -q "They are" <<<"$results"
+'
+
+test_done