Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Defined2014 committed Feb 22, 2024
1 parent a6efc02 commit 1e467ed
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions zap_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,20 @@ func TestRotateLogWithCompress(t *testing.T) {
}
}

func TestCompressError(t *testing.T) {
tempDir := t.TempDir()
conf := &Config{
Level: "info",
File: FileLogConfig{
Filename: tempDir + "/test.log",
MaxSize: 1,
Compress: "xxx",
},
}
_, _, err := InitLogger(conf)
require.Error(t, err)
}

// testLogSpy is a testing.TB that captures logged messages.
type testLogSpy struct {
testing.TB
Expand Down

0 comments on commit 1e467ed

Please sign in to comment.