From: Brandon Casey Date: Sat, 27 Aug 2011 00:59:24 +0000 (-0500) Subject: t/t3905: use the name 'actual' for test output, swap arguments to test_cmp X-Git-Tag: v1.7.8-rc0~144^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4fd731240980f0f4b4565abe9092bd3d08d650e3;p=git.git t/t3905: use the name 'actual' for test output, swap arguments to test_cmp It is common practice in the git test suite to use the file names 'actual' and 'expect' to hold the actual and expected output of commands. So change the name 'output' to 'actual'. Additionally, swap the order of arguments to test_cmp when comparing expected output and actual output so that if diff output is produced, it describes how the actual output differs from what was expected rather than the other way around. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh index 4f2eedfd4..adc25245b 100755 --- a/t/t3905-stash-include-untracked.sh +++ b/t/t3905-stash-include-untracked.sh @@ -23,13 +23,13 @@ test_expect_success 'stash save --include-untracked some dirty working directory ' cat > expect < output - test_cmp output expect + git status --porcelain >actual + test_cmp expect actual ' cat > expect.diff < output && - test_cmp output expect.diff && - git ls-tree --name-only stash^3: > output && - test_cmp output expect.lstree + git diff HEAD..stash^3 -- file2 >actual && + test_cmp expect.diff actual && + git ls-tree --name-only stash^3: >actual && + test_cmp expect.lstree actual ' test_expect_success 'stash save --patch --include-untracked fails' ' test_must_fail git stash --patch --include-untracked @@ -64,15 +64,15 @@ git clean --force --quiet cat > expect < output - test_cmp output expect + git status --porcelain >actual + test_cmp expect actual ' git clean --force --quiet @@ -96,8 +96,8 @@ EOF test_expect_success 'stash save --include-untracked dirty index got stashed' ' git stash pop --index && - git diff --cached > output && - test_cmp output expect + git diff --cached >actual && + test_cmp expect actual ' git reset > /dev/null