Skip to content

Commit 5250162

Browse files
committed
t3420: remove progress lines before comparing output
Some of the tests check the output of rebase is what we expect. These were added after a regression that added unwanted stash output when using --autostash. They are useful as they prevent unintended changes to the output of the various rebase commands. However they also include all the progress output which is less useful as it only tests what would be written to a dumb terminal which is not the normal use case. The recent changes to fix clearing the line when printing progress necessarily meant making an ugly change to these tests. Address this my removing the progress output before comparing it to the expected output. We do this by removing everything before the final "\r" on each line as we don't care about the progress indicator, but we do care about what is printed immediately after it. Signed-off-by: Phillip Wood <[email protected]>
1 parent 5b12e31 commit 5250162

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

t/t3420-rebase-autostash.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ create_expected_success_interactive () {
4848
q_to_cr >expected <<-EOF
4949
$(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
5050
HEAD is now at $(git rev-parse --short feature-branch) third commit
51-
Rebasing (1/2)QRebasing (2/2)QApplied autostash.
52-
Q QSuccessfully rebased and updated refs/heads/rebased-feature-branch.
51+
Applied autostash.
52+
Successfully rebased and updated refs/heads/rebased-feature-branch.
5353
EOF
5454
}
5555

@@ -67,13 +67,13 @@ create_expected_failure_am () {
6767
}
6868

6969
create_expected_failure_interactive () {
70-
q_to_cr >expected <<-EOF
70+
cat >expected <<-EOF
7171
$(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
7272
HEAD is now at $(git rev-parse --short feature-branch) third commit
73-
Rebasing (1/2)QRebasing (2/2)QApplying autostash resulted in conflicts.
73+
Applying autostash resulted in conflicts.
7474
Your changes are safe in the stash.
7575
You can run "git stash pop" or "git stash drop" at any time.
76-
Q QSuccessfully rebased and updated refs/heads/rebased-feature-branch.
76+
Successfully rebased and updated refs/heads/rebased-feature-branch.
7777
EOF
7878
}
7979

@@ -109,7 +109,8 @@ testrebase () {
109109
suffix=interactive
110110
fi &&
111111
create_expected_success_$suffix &&
112-
test_i18ncmp expected actual
112+
sed "$(printf "s/.*\\r//")" <actual >actual2 &&
113+
test_i18ncmp expected actual2
113114
'
114115

115116
test_expect_success "rebase$type: dirty index, non-conflicting rebase" '
@@ -209,7 +210,8 @@ testrebase () {
209210
suffix=interactive
210211
fi &&
211212
create_expected_failure_$suffix &&
212-
test_i18ncmp expected actual
213+
sed "$(printf "s/.*\\r//")" <actual >actual2 &&
214+
test_i18ncmp expected actual2
213215
'
214216
}
215217

0 commit comments

Comments
 (0)