From b0672939bdf4a2eb981df82f95b946d2c61fc639 Mon Sep 17 00:00:00 2001 From: Adam Chalkley Date: Wed, 9 Oct 2024 17:02:48 -0500 Subject: [PATCH] Fix TestEmptyServiceOutputProducesNoOutput test This test unintentionally copy/pasted/modified from another test but stopped short of completing the work. - handle setting up ServiceOutput section instead of the performance data metrics output - update OK message when test completes successfully --- unexported_test.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/unexported_test.go b/unexported_test.go index 95af95a..262870f 100644 --- a/unexported_test.go +++ b/unexported_test.go @@ -152,10 +152,7 @@ func TestEmptyServiceOutputProducesNoOutput(t *testing.T) { // Explicitly indicate that the field is empty (default/zero value). plugin.ServiceOutput = "" - // At this point the collected performance data collection is empty, the - // field used to hold the entries is nil. An attempt to process the empty - // collection should result in no output. - plugin.handlePerformanceData(&outputBuffer) + plugin.handleServiceOutputSection(&outputBuffer) want := "" got := outputBuffer.String() @@ -163,7 +160,7 @@ func TestEmptyServiceOutputProducesNoOutput(t *testing.T) { if want != got { t.Errorf("\nwant %q\ngot %q", want, got) } else { - t.Logf("OK: Empty performance data collection produces no output.") + t.Logf("OK: Empty service output field produces no output.") } }