Add time.Time encoding/decoding test.
It's not clear this is actually the best way to handle time.Time,
since there is a standard yaml format that may not match time.Time's,
but having tests ensuring the current behavior is basically sane
is a good idea nevertheless.
Gustavo Niemeyer
9 years ago
547 | 547 |
{
|
548 | 548 |
"a: 1.2.3.4\n",
|
549 | 549 |
map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)},
|
|
550 |
},
|
|
551 |
{
|
|
552 |
"a: 2015-02-24T15:19:39-03:00\n",
|
|
553 |
map[string]time.Time{"a": time.Unix(1424801979, 0)},
|
550 | 554 |
},
|
551 | 555 |
|
552 | 556 |
// Encode empty lists as zero-length slices.
|
293 | 293 |
{
|
294 | 294 |
map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)},
|
295 | 295 |
"a: 1.2.3.4\n",
|
|
296 |
},
|
|
297 |
{
|
|
298 |
map[string]time.Time{"a": time.Unix(1424801979, 0)},
|
|
299 |
"a: 2015-02-24T15:19:39-03:00\n",
|
296 | 300 |
},
|
297 | 301 |
|
298 | 302 |
// Ensure strings containing ": " are quoted (reported as PR #43, but not reproducible).
|