Codebase list golang-yaml.v2 / 50f7813
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
2 changed file(s) with 8 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
547547 {
548548 "a: 1.2.3.4\n",
549549 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)},
550554 },
551555
552556 // Encode empty lists as zero-length slices.
293293 {
294294 map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)},
295295 "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",
296300 },
297301
298302 // Ensure strings containing ": " are quoted (reported as PR #43, but not reproducible).