summaryrefslogtreecommitdiff
path: root/tests/t0400-grep.sh
blob: b244cf45fc407ca28ccba1993966497032ff3c37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash

test_description='Grep check'
cd "$(dirname "$0")"
. ./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_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
d=cd1a20d2dd5059285f18d0c79779745af412c055&follow=1'>[vim] syntastic configRené 'Necoro' Neumann1-0/+3 2020-05-27Remove vim-latex configsRené 'Necoro' Neumann2-24/+0 2020-04-15Simplify check_libsRené 'Necoro' Neumann1-6/+2 2020-04-15Explicitly set PAGERRené 'Necoro' Neumann1-0/+1 2020-04-12[vim] Syntax coloring by default, if supportedRené 'Necoro' Neumann1-0/+4 2020-04-12Fix scrolling in screenRené 'Necoro' Neumann1-0/+4 2020-04-11UpdateRené 'Necoro' Neumann1-0/+0 2020-04-05Replace git:// by https://René 'Necoro' Neumann1-2/+2 2020-02-17Update urxvt extension configRené 'Necoro' Neumann2-4/+120 2020-02-17Remove urxvt wgetpaste extensionRené 'Necoro' Neumann2-30/+1 2020-02-17[i3] Wifi: Include frequenceRené 'Necoro' Neumann1-1/+1 2020-02-17Put ssh-agent into the i3 environment.René 'Necoro' Neumann1-0/+1 2020-02-17Update cci: stgit now uses python3René 'Necoro' Neumann1-1/+1 2020-02-17Revert "Local Changes"René 'Necoro' Neumann2-5/+3 2020-02-17Update vundleRené 'Necoro' Neumann1-0/+0 2020-02-17Enable secondary screen in urxvtRené 'Necoro' Neumann1-0/+1 2020-02-17Local ChangesRené 'Necoro' Neumann2-3/+5 2018-06-10[i3] Replace icons by font awesomeRené 'Necoro' Neumann24-149/+13 2018-06-10[i3] Remove obsolete pidgin stuffRené 'Necoro' Neumann2-36/+0 2018-06-10[zsh] Remove obsolete isabelle functionsRené 'Necoro' Neumann2-112/+0 2018-06-10Misc changesRené 'Necoro' Neumann3-0/+7 2018-06-10[git] Update email addressRené 'Necoro' Neumann1-1/+1 2018-06-10Enhance cci scriptRené 'Necoro' Neumann1-15/+12 2017-11-18Some windows setupRené 'Necoro' Neumann2-1/+6 2017-10-08[zsh] Use zcalc instead of bcRené 'Necoro' Neumann1-5/+4 2017-10-08[zsh] CalculatorRené 'Necoro' Neumann1-0/+8 2017-10-08Some vim changes.René 'Necoro' Neumann4-28/+17 2017-10-08Delete old stuff.René 'Necoro' Neumann5-71/+1