b2: Fix parsing of mod time when not in metadata

This files this error `Failed to parse mod time string "":
"src_last_modified_millis" not found in metadata`.
This commit is contained in:
Nick Craig-Wood
2016-03-22 10:26:37 +00:00
parent 0dc0052e93
commit 37543bd1d9
2 changed files with 28 additions and 28 deletions
+4 -2
View File
@@ -149,10 +149,12 @@ func TestParseTimeString(t *testing.T) {
}{
{"0", fstest.Time("1970-01-01T00:00:00.000000000Z"), ""},
{"981173110123", fstest.Time("2001-02-03T04:05:10.123000000Z"), ""},
{"", time.Time{}, `"src_last_modified_millis" not found in metadata`},
{"", time.Time{}, ""},
{"potato", time.Time{}, `strconv.ParseInt: parsing "potato": invalid syntax`},
} {
got, err := parseTimeString(test.in)
o := Object{}
err := o.parseTimeString(test.in)
got := o.modTime
var gotError string
if err != nil {
gotError = err.Error()