diff options
author | Matthew DeVore <matvore@google.com> | 2018-10-12 23:01:41 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-15 06:43:17 +0300 |
commit | d9e6d0942bb9f9fe9e4cca9670181e5b59074bcb (patch) | |
tree | cabb90e34c49bc6207b10a510fd87857c716c736 /t/t6112-rev-list-filters-objects.sh | |
parent | bc5975d24f33c974d53b3d94c5697fadaec5b000 (diff) |
filter-trees: code clean-up of tests
A few trivial updates to test to match the current best practices.
- avoid "grep -q" that strips potentially useful output from tests
running under "-v".
- use test_write_lines to prepare multi-line expected output file.
- reserve use of test_must_fail to "git" commands.
Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6112-rev-list-filters-objects.sh')
-rwxr-xr-x | t/t6112-rev-list-filters-objects.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh index 2cbb81d3bb..d24f9d5b5a 100755 --- a/t/t6112-rev-list-filters-objects.sh +++ b/t/t6112-rev-list-filters-objects.sh @@ -38,8 +38,8 @@ test_expect_success 'specify blob explicitly prevents filtering' ' awk -f print_2.awk) && git -C r1 rev-list --objects --filter=blob:none HEAD $file_3 >observed && - grep -q "$file_3" observed && - test_must_fail grep -q "$file_4" observed + grep "$file_3" observed && + ! grep "$file_4" observed ' test_expect_success 'verify emitted+omitted == all' ' @@ -241,7 +241,7 @@ test_expect_success 'verify tree:0 includes trees in "filtered" output' ' xargs -n1 git -C r3 cat-file -t >unsorted_filtered_types && sort -u unsorted_filtered_types >filtered_types && - printf "blob\ntree\n" >expected && + test_write_lines blob tree >expected && test_cmp expected filtered_types ' |