(t *testing.T)
| 483 | } |
| 484 | |
| 485 | func TestAllVersionsExpiration(t *testing.T) { |
| 486 | expected := []byte(`{"Rules":[{"AllVersionsExpiration":{"Days":2,"DeleteMarker":true},"ID":"all-versions-expiration","Status":"Enabled"}]}`) |
| 487 | lc := Configuration{ |
| 488 | Rules: []Rule{ |
| 489 | { |
| 490 | AllVersionsExpiration: AllVersionsExpiration{ |
| 491 | Days: 2, |
| 492 | DeleteMarker: ExpireDeleteMarker(true), |
| 493 | }, |
| 494 | ID: "all-versions-expiration", |
| 495 | Status: "Enabled", |
| 496 | }, |
| 497 | }, |
| 498 | } |
| 499 | |
| 500 | got, err := json.Marshal(lc) |
| 501 | if err != nil { |
| 502 | t.Fatalf("Failed to marshal due to %v", err) |
| 503 | } |
| 504 | if !bytes.Equal(expected, got) { |
| 505 | t.Fatalf("Expected %s but got %s", expected, got) |
| 506 | } |
| 507 | } |
nothing calls this directly
no test coverage detected