[committed] diagnostics, v2: Fix up selftests with $COLUMNS < 42 [PR108973]

Message ID ZAMGZG59v6MuoI43@tucnak
State Committed
Headers
Series [committed] diagnostics, v2: Fix up selftests with $COLUMNS < 42 [PR108973] |

Commit Message

Jakub Jelinek March 4, 2023, 8:50 a.m. UTC
  On Fri, Mar 03, 2023 at 08:54:32AM -0500, David Malcolm wrote:
> Thanks for working on this.
> 
> Patch is OK, but I wonder if it would even better to just hardcode
> caret_max_width as 80 here, to better eliminate that influence from
> from the environment in the unit tests?  I think all of the tests that
> modify caret_max_width do so after the ctor has run.

Thanks, here is what I've committed after another bootstrap/regtest:

2023-03-04  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/108973
	* selftest-diagnostic.cc
	(test_diagnostic_context::test_diagnostic_context): Set
	caret_max_width to 80.



	Jakub
  

Patch

--- gcc/selftest-diagnostic.cc.jj	2023-01-02 09:32:31.991146491 +0100
+++ gcc/selftest-diagnostic.cc	2023-03-02 10:05:17.974321025 +0100
@@ -41,6 +41,7 @@  test_diagnostic_context::test_diagnostic
   show_column = true;
   start_span = start_span_cb;
   min_margin_width = 6;
+  caret_max_width = 80;
 }
 
 test_diagnostic_context::~test_diagnostic_context ()