2024-06-14 18:01:48 -07:00
|
|
|
package log
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/labstack/echo/v4"
|
|
|
|
"github.com/stretchr/testify/assert"
|
2024-07-09 17:57:05 -07:00
|
|
|
|
|
|
|
"git.grosinger.net/tgrosinger/saasitone/pkg/tests"
|
2024-06-14 18:01:48 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestCtxSet(t *testing.T) {
|
|
|
|
ctx, _ := tests.NewContext(echo.New(), "/")
|
|
|
|
logger := Ctx(ctx)
|
|
|
|
assert.NotNil(t, logger)
|
|
|
|
|
|
|
|
logger = logger.With("a", "b")
|
|
|
|
Set(ctx, logger)
|
|
|
|
|
|
|
|
got := Ctx(ctx)
|
|
|
|
assert.Equal(t, got, logger)
|
|
|
|
}
|