From 1e467ed3d218d630382f3bce5d8a11dc9be51c64 Mon Sep 17 00:00:00 2001 From: Jason Mo Date: Thu, 22 Feb 2024 15:33:38 +0800 Subject: [PATCH] update test --- zap_log_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zap_log_test.go b/zap_log_test.go index 1ac359d..153141d 100644 --- a/zap_log_test.go +++ b/zap_log_test.go @@ -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