MCPcopy Index your code
hub / github.com/AlekSi/pointer / TestError

Function TestError

pointer_test.go:115–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

113}
114
115func TestError(t *testing.T) {
116 var x error
117 if *ToError(x) != x {
118 t.Errorf("*ToError(%v)", x)
119 }
120 if ToErrorOrNil(x) != nil {
121 t.Errorf("ToErrorOrNil(%v)", x)
122 }
123 if GetError(nil) != x {
124 t.Errorf("GetError(%v)", nil)
125 }
126
127 x = errors.New("error")
128 if *ToError(x) != x {
129 t.Errorf("*ToError(%v)", x)
130 }
131 if *ToErrorOrNil(x) != x {
132 t.Errorf("*ToErrorOrNil(%v)", x)
133 }
134 if GetError(&x) != x {
135 t.Errorf("GetError(%v)", &x)
136 }
137}
138
139func TestFloat32(t *testing.T) {
140 var x float32

Callers

nothing calls this directly

Calls 3

ToErrorFunction · 0.85
ToErrorOrNilFunction · 0.85
GetErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…