diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-09 11:29:20 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-09 16:45:14 -0700 |
commit | ca8d148daf3014577222c2562ca2c8170a866aa4 (patch) | |
tree | d3225e86102154d591d8b25336eb4166c32efd0a /t/t3903-stash.sh | |
parent | b1d04bfcf84cc3464d0bdf62b02443d0d55e3f2b (diff) | |
download | git-ca8d148daf3014577222c2562ca2c8170a866aa4.tar.gz |
test: test_must_be_empty helper
There are quite a lot places where an output file is expected to be
empty, and we fail the test when it is not. The output from running
the test script with -i -v can be helped if we showed the unexpected
contents at that point.
We could of course do
>expected.empty && test_cmp expected.empty actual
but this is commmon enough to be done with a dedicated helper.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3903-stash.sh')
-rwxr-xr-x | t/t3903-stash.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 5dfbda7491..5473e6196f 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -200,17 +200,17 @@ test_expect_success 'apply -q is quiet' ' echo foo > file && git stash && git stash apply -q > output.out 2>&1 && - test ! -s output.out + test_must_be_empty output.out ' test_expect_success 'save -q is quiet' ' git stash save --quiet > output.out 2>&1 && - test ! -s output.out + test_must_be_empty output.out ' test_expect_success 'pop -q is quiet' ' git stash pop -q > output.out 2>&1 && - test ! -s output.out + test_must_be_empty output.out ' test_expect_success 'pop -q --index works and is quiet' ' @@ -219,13 +219,13 @@ test_expect_success 'pop -q --index works and is quiet' ' git stash save --quiet && git stash pop -q --index > output.out 2>&1 && test foo = "$(git show :file)" && - test ! -s output.out + test_must_be_empty output.out ' test_expect_success 'drop -q is quiet' ' git stash && git stash drop -q > output.out 2>&1 && - test ! -s output.out + test_must_be_empty output.out ' test_expect_success 'stash -k' ' |