Skip to content

Commit

Permalink
parsers: test the noop parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
jrockway committed Jun 19, 2022
1 parent 423a10f commit bf78e5e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/parse/default_parsers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,19 @@ func TestLevelParsers(t *testing.T) {
}
}
}

func TestNoopParsers(t *testing.T) {
testData := []func(){func() { NoopTimeParser(1) }, func() { NoopLevelParser("info") }}
for _, test := range testData {
ok := func() (ok bool) {
defer func() {
ok = recover() != nil
}()
test()
return false
}()
if !ok {
t.Error("expected panic")
}
}
}

0 comments on commit bf78e5e

Please sign in to comment.