28 lines
412 B
Go
28 lines
412 B
Go
package config
|
|
|
|
import (
|
|
"bytes"
|
|
"log/slog"
|
|
"reflect"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func slogToBuffer() (*bytes.Buffer, *slog.Logger) {
|
|
buf := new(bytes.Buffer)
|
|
return buf, slog.New(
|
|
slog.NewTextHandler(
|
|
buf,
|
|
&slog.HandlerOptions{
|
|
Level: LevelTrace,
|
|
},
|
|
),
|
|
)
|
|
}
|
|
|
|
func TestNew(t *testing.T) {
|
|
c := New()
|
|
assert.Equal(t, "config.Config", reflect.TypeOf(c).String())
|
|
}
|