MCPcopy Create free account
hub / github.com/AlekSi/pointer / TestComplex128

Function TestComplex128

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

Source from the content-addressed store, hash-verified

89}
90
91func TestComplex128(t *testing.T) {
92 var x complex128
93 if *ToComplex128(x) != x {
94 t.Errorf("*ToComplex128(%v)", x)
95 }
96 if ToComplex128OrNil(x) != nil {
97 t.Errorf("ToComplex128OrNil(%v)", x)
98 }
99 if GetComplex128(nil) != x {
100 t.Errorf("GetComplex128(%v)", nil)
101 }
102
103 x = 42
104 if *ToComplex128(x) != x {
105 t.Errorf("*ToComplex128(%v)", x)
106 }
107 if *ToComplex128OrNil(x) != x {
108 t.Errorf("*ToComplex128OrNil(%v)", x)
109 }
110 if GetComplex128(&x) != x {
111 t.Errorf("GetComplex128(%v)", &x)
112 }
113}
114
115func TestError(t *testing.T) {
116 var x error

Callers

nothing calls this directly

Calls 3

ToComplex128Function · 0.85
ToComplex128OrNilFunction · 0.85
GetComplex128Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…