git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] progress.c tests: fix breakage with COLUMNS != 80
@ 2021-06-21  7:01 Ævar Arnfjörð Bjarmason
  2021-06-23 23:48 ` Jeff King
  2021-06-24 10:19 ` [PATCH] test-lib.sh: set COLUMNS=80 for --verbose repeatability Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 10+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-06-21  7:01 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, SZEDER Gábor,
	Ævar Arnfjörð Bjarmason

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.595.g55105f1e212


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-06-29 11:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21  7:01 [PATCH] progress.c tests: fix breakage with COLUMNS != 80 Ævar Arnfjörð Bjarmason
2021-06-23 23:48 ` Jeff King
2021-06-24  5:12   ` SZEDER Gábor
2021-06-24  5:40     ` Jeff King
2021-06-24 15:05   ` Philip Oakley
2021-06-24 10:19 ` [PATCH] test-lib.sh: set COLUMNS=80 for --verbose repeatability Ævar Arnfjörð Bjarmason
2021-06-24 14:50   ` Jeff King
2021-06-27  7:44   ` SZEDER Gábor
2021-06-29  1:42     ` Junio C Hamano
2021-06-29 11:29   ` [PATCH v2] " Ævar Arnfjörð Bjarmason

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).