nginx-proxy-manager-zh/backend/internal/api/context/context_test.go

18 lines
385 B
Go
Raw Normal View History

2023-07-24 21:59:02 -04:00
package context
import (
"testing"
"github.com/stretchr/testify/assert"
2023-11-07 18:57:15 -05:00
"go.uber.org/goleak"
2023-07-24 21:59:02 -04:00
)
func TestGetString(t *testing.T) {
2023-11-07 18:57:15 -05:00
// goleak is used to detect goroutine leaks
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
2023-07-24 21:59:02 -04:00
t.Run("basic test", func(t *testing.T) {
assert.Equal(t, "context value: Body", BodyCtxKey.String())
})
}