(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestRelaxedTimeFormat(t *testing.T) { |
| 14 | rt := time.Date(1981, 02, 03, 14, 15, 16, 17, time.UTC) |
| 15 | assert.Check(t, is.Equal("1981-02-03T14:15:16Z", RelaxedTime(rt).String())) |
| 16 | |
| 17 | buf, err := RelaxedTime(rt).MarshalText() |
| 18 | assert.Check(t, err) |
| 19 | assert.Check(t, is.Equal("1981-02-03T14:15:16Z", string(buf))) |
| 20 | |
| 21 | loc, err := time.LoadLocation("America/New_York") |
| 22 | assert.Check(t, err) |
| 23 | rt = time.Date(1981, 02, 03, 9, 15, 16, 17, loc) |
| 24 | |
| 25 | assert.Check(t, is.Equal("1981-02-03T14:15:16Z", RelaxedTime(rt).String())) |
| 26 | buf, err = RelaxedTime(rt).MarshalText() |
| 27 | assert.Check(t, err) |
| 28 | assert.Check(t, is.Equal("1981-02-03T14:15:16Z", string(buf))) |
| 29 | } |
| 30 | |
| 31 | func TestRelaxedTimeParse(t *testing.T) { |
| 32 | { |
nothing calls this directly
no test coverage detected