Skip to content

Commit 4fd7312

Browse files
drafnelgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7875130 commit 4fd7312

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

t/t3905-stash-include-untracked.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ test_expect_success 'stash save --include-untracked some dirty working directory
2323
'
2424

2525
cat > expect <<EOF
26+
?? actual
2627
?? expect
27-
?? output
2828
EOF
2929

3030
test_expect_success 'stash save --include-untracked cleaned the untracked files' '
31-
git status --porcelain > output
32-
test_cmp output expect
31+
git status --porcelain >actual
32+
test_cmp expect actual
3333
'
3434

3535
cat > expect.diff <<EOF
@@ -47,10 +47,10 @@ EOF
4747

4848
test_expect_success 'stash save --include-untracked stashed the untracked files' '
4949
test "!" -f file2 &&
50-
git diff HEAD..stash^3 -- file2 > output &&
51-
test_cmp output expect.diff &&
52-
git ls-tree --name-only stash^3: > output &&
53-
test_cmp output expect.lstree
50+
git diff HEAD..stash^3 -- file2 >actual &&
51+
test_cmp expect.diff actual &&
52+
git ls-tree --name-only stash^3: >actual &&
53+
test_cmp expect.lstree actual
5454
'
5555
test_expect_success 'stash save --patch --include-untracked fails' '
5656
test_must_fail git stash --patch --include-untracked
@@ -64,15 +64,15 @@ git clean --force --quiet
6464

6565
cat > expect <<EOF
6666
M file
67+
?? actual
6768
?? expect
6869
?? file2
69-
?? output
7070
EOF
7171

7272
test_expect_success 'stash pop after save --include-untracked leaves files untracked again' '
7373
git stash pop &&
74-
git status --porcelain > output
75-
test_cmp output expect
74+
git status --porcelain >actual
75+
test_cmp expect actual
7676
'
7777

7878
git clean --force --quiet
@@ -96,8 +96,8 @@ EOF
9696

9797
test_expect_success 'stash save --include-untracked dirty index got stashed' '
9898
git stash pop --index &&
99-
git diff --cached > output &&
100-
test_cmp output expect
99+
git diff --cached >actual &&
100+
test_cmp expect actual
101101
'
102102

103103
git reset > /dev/null

0 commit comments

Comments
 (0)