From 6de74f5996ad21ee9ccbbb6edc02c11ecde1ddea Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Mon, 28 Jul 2025 12:01:50 +0200 Subject: [PATCH] improve error reporting if asserting no diags --- internal/tfdiags/testing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/tfdiags/testing.go b/internal/tfdiags/testing.go index 0d2bb4d10f..c918cd9056 100644 --- a/internal/tfdiags/testing.go +++ b/internal/tfdiags/testing.go @@ -69,7 +69,7 @@ func AssertDiagnosticCount(t *testing.T, diags Diagnostics, want int) { if len(diags) != want { t.Errorf("wrong number of diagnostics %d; want %d", len(diags), want) for _, diag := range diags { - t.Logf("- %#v", diag) + t.Logf("- [%s] %s: %s", diag.Severity(), diag.Description().Summary, diag.Description().Detail) } t.FailNow() }