(t *testing.T)
| 30 | } |
| 31 | |
| 32 | func TestDurationMillis(t *testing.T) { |
| 33 | cases := []struct { |
| 34 | d time.Duration |
| 35 | m uint64 |
| 36 | }{ |
| 37 | {d: time.Second, m: 1000}, |
| 38 | {d: time.Minute, m: 60000}, |
| 39 | {d: time.Hour, m: 3600000}, |
| 40 | {d: time.Hour * 24, m: 86400000}, |
| 41 | } |
| 42 | |
| 43 | for _, c := range cases { |
| 44 | gotM := DurationMillis(c.d) |
| 45 | if gotM != c.m { |
| 46 | t.Errorf("Millis(%v) = %d want %d", c.d, gotM, c.m) |
| 47 | } |
| 48 | |
| 49 | gotD := MillisDuration(c.m) |
| 50 | if gotD != c.d { |
| 51 | t.Errorf("FromMillis(%d) = %v want %v", c.m, gotD, c.d) |
| 52 | } |
| 53 | } |
| 54 | } |
nothing calls this directly
no test coverage detected