(t *testing.T)
| 109 | } |
| 110 | |
| 111 | func 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 | |
| 130 | func TestGetType(t *testing.T) { |
| 131 | type Foo struct{ X int } |
nothing calls this directly
no test coverage detected
searching dependent graphs…