fix test error on ubuntu (#1048)

master
Kevin Wan 3 years ago committed by GitHub
parent 5c6a3132eb
commit f4bb9f5635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,6 +3,7 @@ package logx
import (
"os"
"path/filepath"
"syscall"
"testing"
"time"
@ -97,7 +98,13 @@ func TestRotateLoggerRotate(t *testing.T) {
}()
}
err = logger.rotate()
switch v := err.(type) {
case *os.LinkError:
// avoid rename error on ubuntu
assert.Equal(t, syscall.EXDEV, v.Err)
default:
assert.Nil(t, err)
}
}
func TestRotateLoggerWrite(t *testing.T) {

@ -1,3 +1,4 @@
//go:build !linux
// +build !linux
package internal

Loading…
Cancel
Save