(t *testing.T)
| 297 | } |
| 298 | |
| 299 | func TestRepositoryUpgrade_checkIndexInfo(t *testing.T) { |
| 300 | tcs := []struct { |
| 301 | indexInfo0 content.Info |
| 302 | indexInfo1 content.Info |
| 303 | expectRegexs []string |
| 304 | }{ |
| 305 | { |
| 306 | indexInfo0: content.Info{PackBlobID: "a"}, |
| 307 | indexInfo1: content.Info{PackBlobID: "a"}, |
| 308 | expectRegexs: []string{}, |
| 309 | }, |
| 310 | { |
| 311 | indexInfo0: content.Info{PackBlobID: "a"}, |
| 312 | indexInfo1: content.Info{PackBlobID: "b"}, |
| 313 | expectRegexs: []string{ |
| 314 | `do not match: "a", "b".*PackBlobID`, |
| 315 | }, |
| 316 | }, |
| 317 | { |
| 318 | indexInfo0: content.Info{TimestampSeconds: 1}, |
| 319 | indexInfo1: content.Info{TimestampSeconds: 1}, |
| 320 | expectRegexs: []string{}, |
| 321 | }, |
| 322 | { |
| 323 | indexInfo0: content.Info{TimestampSeconds: 1}, |
| 324 | indexInfo1: content.Info{TimestampSeconds: 2}, |
| 325 | expectRegexs: []string{ |
| 326 | "do not match.*TimestampSeconds", |
| 327 | }, |
| 328 | }, |
| 329 | { |
| 330 | indexInfo0: content.Info{OriginalLength: 1}, |
| 331 | indexInfo1: content.Info{OriginalLength: 1}, |
| 332 | expectRegexs: []string{}, |
| 333 | }, |
| 334 | { |
| 335 | indexInfo0: content.Info{OriginalLength: 1}, |
| 336 | indexInfo1: content.Info{OriginalLength: 2}, |
| 337 | expectRegexs: []string{ |
| 338 | "do not match.*OriginalLength", |
| 339 | }, |
| 340 | }, |
| 341 | { |
| 342 | indexInfo0: content.Info{PackedLength: 1}, |
| 343 | indexInfo1: content.Info{PackedLength: 1}, |
| 344 | expectRegexs: []string{}, |
| 345 | }, |
| 346 | { |
| 347 | indexInfo0: content.Info{PackedLength: 1}, |
| 348 | indexInfo1: content.Info{PackedLength: 2}, |
| 349 | expectRegexs: []string{ |
| 350 | "do not match.*PackedLength", |
| 351 | }, |
| 352 | }, |
| 353 | { |
| 354 | indexInfo0: content.Info{PackOffset: 1}, |
| 355 | indexInfo1: content.Info{PackOffset: 1}, |
| 356 | expectRegexs: []string{}, |
nothing calls this directly
no test coverage detected