You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
522 B
23 lines
522 B
package log_test
|
|
|
|
import (
|
|
"cynking.com/pkg/log"
|
|
"fmt"
|
|
"github.com/stretchr/testify/assert"
|
|
"testing"
|
|
)
|
|
|
|
func Test_Options_Validate(t *testing.T) {
|
|
opts := &log.Options{
|
|
Level: "test",
|
|
Format: "test",
|
|
EnableColor: true,
|
|
DisableCaller: false,
|
|
OutputPaths: []string{"stdout"},
|
|
ErrorOutputPaths: []string{"stderr"},
|
|
}
|
|
|
|
errs := opts.Validate()
|
|
expected := `[unrecognized level: "test" not a valid log format: "test"]`
|
|
assert.Equal(t, expected, fmt.Sprintf("%s", errs))
|
|
}
|