From 7552f0cdeeab79c5ff2609dba0b06f5cac2b7ed8 Mon Sep 17 00:00:00 2001 From: Lan Liang Date: Tue, 30 Jul 2024 12:57:15 +0000 Subject: [PATCH] Improve test for no logmessage test. Signed-off-by: Lan Liang --- pkg/tools/testing/reporter_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/tools/testing/reporter_test.go b/pkg/tools/testing/reporter_test.go index 2429551b..349913a4 100644 --- a/pkg/tools/testing/reporter_test.go +++ b/pkg/tools/testing/reporter_test.go @@ -9,6 +9,10 @@ func TestPrettyReporter(t *testing.T) { var buf bytes.Buffer result := TestResult{ Info: []TestCaseInfo{ + { + Name: "test_not_log_message", + Duration: 1024, + }, { Name: "test_foo", Duration: 1024, @@ -30,13 +34,14 @@ func TestPrettyReporter(t *testing.T) { t.Fatal(err) } - exp := `test_foo: PASS (1ms) + exp := `test_not_log_message: PASS (1ms) +test_foo: PASS (1ms) log message test_bar: FAIL (2ms) Error: assert failed -------------------------------------------------------------------------------- -PASS: 1/2 -FAIL: 1/2 +PASS: 2/3 +FAIL: 1/3 ` if exp != buf.String() {