[PATCH 01/25] progress.c tests: fix breakage with COLUMNS != 80
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jun 23, 2021, 17:48 UTC
- Message-ID
- <patch-01.25-cba5d88ca35-20210623T155626Z-avarab@gmail.com>
- In-Reply-To
- <cover-00.25-00000000000-20210623T155626Z-avarab@gmail.com>
The tests added in 2bb74b53a49 (Test the progress display, 2019-09-16) broke under anything except COLUMNS=80, i.e. when running them under the "-v" mode under a differently sized terminal.
Let's set the expected number of COLUMNS at the start of the test to fix that bug. It's handy not do do this in test-progress.c itself, in case we'd like to test for a different number of COLUMNS, either manually or in a future test.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- t/t0500-progress-display.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/t/t0500-progress-display.sh b/t/t0500-progress-display.sh index 22058b503ac..66c092a0fe3 100755 --- a/t/t0500-progress-display.sh +++ b/t/t0500-progress-display.sh @@ -8,6 +8,11 @@ show_cr () { tr '\015' Q | sed -e "s/Q/<CR>\\$LF/g" } +test_expect_success 'setup COLUMNS' ' + COLUMNS=80 && + export COLUMNS +' + test_expect_success 'simple progress display' ' cat >expect <<-\EOF && Working hard: 1<CR>
-- 2.32.0.599.g3967b4fa4ac