From 094c5b3ca856d57c0dd0c7803a0dbbfe9c9a9a61 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 23 Apr 2014 19:03:01 +0200 Subject: tests: add grep test --- tests/t0400-grep.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 tests/t0400-grep.sh 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 -- cgit v1.2.3