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 <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brandon Casey 2011-08-26 19:59:24 -05:00 committed by Junio C Hamano
parent 787513027a
commit 4fd7312409

View File

@ -23,13 +23,13 @@ test_expect_success 'stash save --include-untracked some dirty working directory
' '
cat > expect <<EOF cat > expect <<EOF
?? actual
?? expect ?? expect
?? output
EOF EOF
test_expect_success 'stash save --include-untracked cleaned the untracked files' ' test_expect_success 'stash save --include-untracked cleaned the untracked files' '
git status --porcelain > output git status --porcelain >actual
test_cmp output expect test_cmp expect actual
' '
cat > expect.diff <<EOF cat > expect.diff <<EOF
@ -47,10 +47,10 @@ EOF
test_expect_success 'stash save --include-untracked stashed the untracked files' ' test_expect_success 'stash save --include-untracked stashed the untracked files' '
test "!" -f file2 && test "!" -f file2 &&
git diff HEAD..stash^3 -- file2 > output && git diff HEAD..stash^3 -- file2 >actual &&
test_cmp output expect.diff && test_cmp expect.diff actual &&
git ls-tree --name-only stash^3: > output && git ls-tree --name-only stash^3: >actual &&
test_cmp output expect.lstree test_cmp expect.lstree actual
' '
test_expect_success 'stash save --patch --include-untracked fails' ' test_expect_success 'stash save --patch --include-untracked fails' '
test_must_fail git stash --patch --include-untracked test_must_fail git stash --patch --include-untracked
@ -64,15 +64,15 @@ git clean --force --quiet
cat > expect <<EOF cat > expect <<EOF
M file M file
?? actual
?? expect ?? expect
?? file2 ?? file2
?? output
EOF EOF
test_expect_success 'stash pop after save --include-untracked leaves files untracked again' ' test_expect_success 'stash pop after save --include-untracked leaves files untracked again' '
git stash pop && git stash pop &&
git status --porcelain > output git status --porcelain >actual
test_cmp output expect test_cmp expect actual
' '
git clean --force --quiet git clean --force --quiet
@ -96,8 +96,8 @@ EOF
test_expect_success 'stash save --include-untracked dirty index got stashed' ' test_expect_success 'stash save --include-untracked dirty index got stashed' '
git stash pop --index && git stash pop --index &&
git diff --cached > output && git diff --cached >actual &&
test_cmp output expect test_cmp expect actual
' '
git reset > /dev/null git reset > /dev/null