diff options
Diffstat (limited to 't/t7811-grep-open.sh')
-rwxr-xr-x | t/t7811-grep-open.sh | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh index e1951a5cbb..d1ebfd88c7 100755 --- a/t/t7811-grep-open.sh +++ b/t/t7811-grep-open.sh @@ -51,14 +51,13 @@ test_expect_success SIMPLEPAGER 'git grep -O' ' grep.h EOF echo grep.h >expect.notless && - >empty && PATH=.:$PATH git grep -O GREP_PATTERN >out && { test_cmp expect.less pager-args || test_cmp expect.notless pager-args } && - test_cmp empty out + test_must_be_empty out ' test_expect_success 'git grep -O --cached' ' @@ -72,7 +71,6 @@ test_expect_success 'git grep -O --no-index' ' grep.h untracked EOF - >empty && ( GIT_PAGER='\''printf "%s\n" >pager-args'\'' && @@ -80,7 +78,7 @@ test_expect_success 'git grep -O --no-index' ' git grep --no-index -O GREP_PATTERN >out ) && test_cmp expect pager-args && - test_cmp empty out + test_must_be_empty out ' test_expect_success 'setup: fake "less"' ' @@ -96,15 +94,14 @@ test_expect_success 'git grep -O jumps to line in less' ' +/*GREP_PATTERN grep.h EOF - >empty && GIT_PAGER=./less git grep -O GREP_PATTERN >out && test_cmp expect actual && - test_cmp empty out && + test_must_be_empty out && git grep -O./less GREP_PATTERN >out2 && test_cmp expect actual && - test_cmp empty out2 + test_must_be_empty out2 ' test_expect_success 'modified file' ' @@ -122,7 +119,7 @@ test_expect_success 'modified file' ' test_when_finished "git checkout HEAD unrelated" && GIT_PAGER=./less git grep -F -O "enum grep_pat_token" >out && test_cmp expect actual && - test_cmp empty out + test_must_be_empty out ' test_expect_success 'copes with color settings' ' @@ -138,7 +135,6 @@ test_expect_success 'copes with color settings' ' test_expect_success 'run from subdir' ' rm -f actual && echo grep.c >expect && - >empty && ( cd subdir && @@ -156,8 +152,8 @@ test_expect_success 'run from subdir' ' ;; esac && test_cmp expect args && - test_cmp empty out && - test_cmp empty out2 + test_must_be_empty out && + test_must_be_empty out2 ' test_done |