MCPcopy Create free account
hub / github.com/imroc/req / TestGetPointer

Function TestGetPointer

internal/util/util_test.go:111–128  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

109}
110
111func TestGetPointer(t *testing.T) {
112 type Foo struct{ X int }
113 var f Foo
114 p := GetPointer(&f)
115 if p == nil {
116 t.Fatal("GetPointer returned nil")
117 }
118 // p should be *Foo
119 if _, ok := p.(*Foo); !ok {
120 t.Fatalf("GetPointer returned %T, want *Foo", p)
121 }
122
123 // Non-pointer input
124 p2 := GetPointer(Foo{})
125 if p2 == nil {
126 t.Fatal("GetPointer returned nil for non-pointer")
127 }
128}
129
130func TestGetType(t *testing.T) {
131 type Foo struct{ X int }

Callers

nothing calls this directly

Calls 1

GetPointerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…