(t *testing.T)
| 54 | } |
| 55 | |
| 56 | func TestParseTimestamp(t *testing.T) { |
| 57 | tm := time.Unix(1620000000, 123000000) |
| 58 | if !tm.Equal(*parseTimestamp("1620000000123")) { |
| 59 | t.Error("Parse unix time failed") |
| 60 | } |
| 61 | if !tm.Equal(*parseTimestamp(tm.Format(time.RFC3339Nano))) { |
| 62 | t.Error("Parse string time nano failed") |
| 63 | } |
| 64 | tm2 := time.Unix(1620000000, 0) |
| 65 | if !tm2.Equal(*parseTimestamp(tm.Format(time.RFC3339))) { |
| 66 | t.Error("Parse string time failed") |
| 67 | } |
| 68 | if !tm.Equal(*parseTimestamp(1620000000123)) { |
| 69 | t.Error("Parse int time failed") |
| 70 | } |
| 71 | if !tm.Equal(*parseTimestamp(uint(1620000000123))) { |
| 72 | t.Error("Parse uint time failed") |
| 73 | } |
| 74 | if !tm.Equal(*parseTimestamp(int64(1620000000123))) { |
| 75 | t.Error("Parse int64 time failed") |
| 76 | } |
| 77 | if !tm.Equal(*parseTimestamp(uint64(1620000000123))) { |
| 78 | t.Error("Parse uint64 failed") |
| 79 | } |
| 80 | } |
nothing calls this directly
no test coverage detected