(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func 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 | |
| 41 | func TestBuildOauthTokenURL(t *testing.T) { |
| 42 | url := BuildOauthTokenURL("cli-demo.us.auth0.com") |
nothing calls this directly
no test coverage detected