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

Function TestTime

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

Source from the content-addressed store, hash-verified

521}
522
523func TestTime(t *testing.T) {
524 var x time.Time
525 if *ToTime(x) != x {
526 t.Errorf("*ToTime(%v)", x)
527 }
528 if ToTimeOrNil(x) != nil {
529 t.Errorf("ToTimeOrNil(%v)", x)
530 }
531 if GetTime(nil) != x {
532 t.Errorf("GetTime(%v)", nil)
533 }
534
535 x = time.Date(2014, 6, 25, 12, 24, 40, 0, time.UTC)
536 if *ToTime(x) != x {
537 t.Errorf("*ToTime(%v)", x)
538 }
539 if *ToTimeOrNil(x) != x {
540 t.Errorf("*ToTimeOrNil(%v)", x)
541 }
542 if GetTime(&x) != x {
543 t.Errorf("GetTime(%v)", &x)
544 }
545}
546
547func Example() {
548 const (

Callers

nothing calls this directly

Calls 3

ToTimeFunction · 0.85
ToTimeOrNilFunction · 0.85
GetTimeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…