Skip to content

Commit

Permalink
Improve test for no logmessage test. (#362)
Browse files Browse the repository at this point in the history
Signed-off-by: Lan Liang <[email protected]>
  • Loading branch information
liangyuanpeng authored Jul 30, 2024
1 parent 1b4ecc9 commit e870833
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/tools/testing/reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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() {
Expand Down

0 comments on commit e870833

Please sign in to comment.