(t *testing.T)
| 36 | } |
| 37 | |
| 38 | func TestCSTTime(t *testing.T) { |
| 39 | pairs := map[string]time.Time{ |
| 40 | `{ "Created": "2021-07-30 19:14:33" }`: TimeMustParse("2021-07-30T11:14:33Z"), |
| 41 | `{ "Created": "2021-07-30" }`: TimeMustParse("2021-07-29T16:00:00Z"), |
| 42 | } |
| 43 | |
| 44 | for input, expected := range pairs { |
| 45 | var record CSTTimeRecord |
| 46 | err := errors.Convert(json.Unmarshal([]byte(input), &record)) |
| 47 | assert.Nil(t, err) |
| 48 | assert.Equal(t, expected, time.Time(record.Created).UTC()) |
| 49 | } |
| 50 | } |
nothing calls this directly
no test coverage detected