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

Function TestString

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

Source from the content-addressed store, hash-verified

329}
330
331func TestString(t *testing.T) {
332 var x string
333 if *ToString(x) != x {
334 t.Errorf("*ToString(%v)", x)
335 }
336 if ToStringOrNil(x) != nil {
337 t.Errorf("ToStringOrNil(%v)", x)
338 }
339 if GetString(nil) != x {
340 t.Errorf("GetString(%v)", nil)
341 }
342
343 x = "x"
344 if *ToString(x) != x {
345 t.Errorf("*ToString(%v)", x)
346 }
347 if *ToStringOrNil(x) != x {
348 t.Errorf("*ToStringOrNil(%v)", x)
349 }
350 if GetString(&x) != x {
351 t.Errorf("GetString(%v)", &x)
352 }
353}
354
355func TestUint(t *testing.T) {
356 var x uint

Callers

nothing calls this directly

Calls 3

ToStringFunction · 0.85
ToStringOrNilFunction · 0.85
GetStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…