MCPcopy Create free account
hub / github.com/auth0/auth0-cli / TestStringPtr

Function TestStringPtr

internal/cli/utils_shared_test.go:17–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func TestStringPtr(t *testing.T) {
18 t.Run("returns nil when input is nil", func(t *testing.T) {
19 type CustomString string
20 var nilPtr *CustomString
21 result := stringPtr(nilPtr)
22 assert.Nil(t, result)
23 })
24
25 t.Run("converts custom string pointer to string pointer", func(t *testing.T) {
26 type CustomString string
27 value := CustomString("test-value")
28 result := stringPtr(&value)
29 assert.NotNil(t, result)
30 assert.Equal(t, "test-value", *result)
31 })
32
33 t.Run("converts regular string pointer to string pointer", func(t *testing.T) {
34 value := "regular-string"
35 result := stringPtr(&value)
36 assert.NotNil(t, result)
37 assert.Equal(t, "regular-string", *result)
38 })
39}
40
41func TestBuildOauthTokenURL(t *testing.T) {
42 url := BuildOauthTokenURL("cli-demo.us.auth0.com")

Callers

nothing calls this directly

Calls 2

stringPtrFunction · 0.85
CustomStringTypeAlias · 0.85

Tested by

no test coverage detected