personal-site/internal/log/log_test.go
2026-05-20 16:09:54 +01:00

21 lines
384 B
Go

package log
import (
"testing"
"github.com/labstack/echo/v4"
"github.com/camzawacki/personal-site/internal/tests"
"github.com/stretchr/testify/assert"
)
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)
}