(t *testing.T)
| 159 | } |
| 160 | |
| 161 | func TestParseTimeString(t *testing.T) { |
| 162 | for _, test := range []struct { |
| 163 | in string |
| 164 | want time.Time |
| 165 | wantError string |
| 166 | }{ |
| 167 | {"0", fstest.Time("1970-01-01T00:00:00.000000000Z"), ""}, |
| 168 | {"981173110123", fstest.Time("2001-02-03T04:05:10.123000000Z"), ""}, |
| 169 | {"", time.Time{}, ""}, |
| 170 | {"potato", time.Time{}, `strconv.ParseInt: parsing "potato": invalid syntax`}, |
| 171 | } { |
| 172 | o := Object{} |
| 173 | err := o.parseTimeString(test.in) |
| 174 | got := o.modTime |
| 175 | var gotError string |
| 176 | if err != nil { |
| 177 | gotError = err.Error() |
| 178 | } |
| 179 | if test.want != got { |
| 180 | t.Logf("%v: want %v got %v", test.in, test.want, got) |
| 181 | } |
| 182 | if test.wantError != gotError { |
| 183 | t.Logf("%v: want error %v got error %v", test.in, test.wantError, gotError) |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | } |
| 188 | |
| 189 | // Return a map of the headers in the options with keys stripped of the "x-bz-info-" prefix |
| 190 | func OpenOptionToMetaData(options []fs.OpenOption) map[string]string { |
nothing calls this directly
no test coverage detected
searching dependent graphs…