Skip to content

Commit dcbaa0b

Browse files
matvoregitster
authored andcommitted
t/*: fix ordering of expected/observed arguments
Fix various places where the ordering was obviously wrong, meaning it was easy to find with grep. Signed-off-by: Matthew DeVore <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bdbc17e commit dcbaa0b

32 files changed

+112
-112
lines changed

t/t0000-basic.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ test_expect_success SHA1 'validate git diff-files output for a know cache/work t
10181018
:120000 120000 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c 0000000000000000000000000000000000000000 M path3/subp3/file3sym
10191019
EOF
10201020
git diff-files >current &&
1021-
test_cmp current expected
1021+
test_cmp expected current
10221022
'
10231023

10241024
test_expect_success 'git update-index --refresh should succeed' '

t/t0021-conversion.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ test_expect_success expanded_in_repo '
166166
rm -f expanded-keywords expanded-keywords-crlf &&
167167
168168
git checkout -- expanded-keywords &&
169-
test_cmp expanded-keywords expected-output &&
169+
test_cmp expected-output expanded-keywords &&
170170
171171
git checkout -- expanded-keywords-crlf &&
172-
test_cmp expanded-keywords-crlf expected-output-crlf
172+
test_cmp expected-output-crlf expanded-keywords-crlf
173173
'
174174

175175
# The use of %f in a filter definition is expanded to the path to

t/t1300-config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ EOF
10011001

10021002
test_expect_success 'value continued on next line' '
10031003
git config --list > result &&
1004-
test_cmp result expect
1004+
test_cmp expect result
10051005
'
10061006

10071007
cat > .git/config <<\EOF
@@ -1882,7 +1882,7 @@ test_expect_success '--replace-all does not invent newlines' '
18821882
Qkey = b
18831883
EOF
18841884
git config --replace-all abc.key b &&
1885-
test_cmp .git/config expect
1885+
test_cmp expect .git/config
18861886
'
18871887

18881888
test_done

t/t1303-wacky-config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ setup() {
1414
check() {
1515
echo "$2" >expected
1616
git config --get "$1" >actual 2>&1
17-
test_cmp actual expected
17+
test_cmp expected actual
1818
}
1919

2020
# 'check section.key regex value' verifies that the entry for
2121
# section.key *that matches 'regex'* is 'value'
2222
check_regex() {
2323
echo "$3" >expected
2424
git config --get "$1" "$2" >actual 2>&1
25-
test_cmp actual expected
25+
test_cmp expected actual
2626
}
2727

2828
test_expect_success 'modify same key' '

t/t2101-update-index-reupdate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ test_expect_success 'update-index --update from subdir' '
7373
100644 $(git hash-object dir1/file3) 0 dir1/file3
7474
100644 $file2 0 file2
7575
EOF
76-
test_cmp current expected
76+
test_cmp expected current
7777
'
7878

7979
test_expect_success 'update-index --update with pathspec' '

t/t3200-branch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ test_expect_success 'use --edit-description' '
12211221
EOF
12221222
EDITOR=./editor git branch --edit-description &&
12231223
echo "New contents" >expect &&
1224-
test_cmp EDITOR_OUTPUT expect
1224+
test_cmp expect EDITOR_OUTPUT
12251225
'
12261226

12271227
test_expect_success 'detect typo in branch name when using --edit-description' '

t/t3320-notes-merge-worktrees.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '
4444
git config core.notesRef refs/notes/y &&
4545
test_must_fail git notes merge z &&
4646
echo "ref: refs/notes/y" >expect &&
47-
test_cmp .git/NOTES_MERGE_REF expect
47+
test_cmp expect .git/NOTES_MERGE_REF
4848
'
4949

5050
test_expect_success 'merge z into y while mid-merge in another workdir fails' '
@@ -66,7 +66,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '
6666
grep -v "A notes merge into refs/notes/x is already in-progress in" out
6767
) &&
6868
echo "ref: refs/notes/x" >expect &&
69-
test_cmp .git/worktrees/worktree2/NOTES_MERGE_REF expect
69+
test_cmp expect .git/worktrees/worktree2/NOTES_MERGE_REF
7070
'
7171

7272
test_done

t/t3400-rebase.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' '
183183
test_commit final_B B "Final B" &&
184184
git rebase &&
185185
echo Amended >expect &&
186-
test_cmp A expect &&
186+
test_cmp expect A &&
187187
echo "Final B" >expect &&
188-
test_cmp B expect &&
188+
test_cmp expect B &&
189189
echo C >expect &&
190-
test_cmp C expect &&
190+
test_cmp expect C &&
191191
echo D >expect &&
192-
test_cmp D expect
192+
test_cmp expect D
193193
'
194194

195195
test_expect_success 'rebase -q is quiet' '

t/t3417-rebase-whitespace-fix.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test_expect_success 'blank line at end of file; extend at end of file' '
5555
git add file && git commit -m second &&
5656
git rebase --whitespace=fix HEAD^^ &&
5757
git diff --exit-code HEAD^:file expect-first &&
58-
test_cmp file expect-second
58+
test_cmp expect-second file
5959
'
6060

6161
# prepare third revision of "file"
@@ -82,7 +82,7 @@ test_expect_success 'two blanks line at end of file; extend at end of file' '
8282
cp third file && git add file && git commit -m third &&
8383
git rebase --whitespace=fix HEAD^^ &&
8484
git diff --exit-code HEAD^:file expect-second &&
85-
test_cmp file expect-third
85+
test_cmp expect-third file
8686
'
8787

8888
test_expect_success 'same, but do not remove trailing spaces' '
@@ -120,7 +120,7 @@ test_expect_success 'at beginning of file' '
120120
done >> file &&
121121
git commit -m more file &&
122122
git rebase --whitespace=fix HEAD^^ &&
123-
test_cmp file expect-beginning
123+
test_cmp expect-beginning file
124124
'
125125

126126
test_done

t/t3702-add-edit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ test_expect_success 'add -e' '
110110
cp second-part file &&
111111
git add -e &&
112112
test_cmp second-part file &&
113-
test_cmp orig-patch expected-patch &&
113+
test_cmp expected-patch orig-patch &&
114114
git diff --cached >actual &&
115115
grep -v index actual >out &&
116-
test_cmp out expected
116+
test_cmp expected out
117117
118118
'
119119

0 commit comments

Comments
 (0)