(t *testing.T)
| 24 | ) |
| 25 | |
| 26 | func TestCORSXMLMarshal(t *testing.T) { |
| 27 | fileContents, err := os.ReadFile("testdata/example.xml") |
| 28 | if err != nil { |
| 29 | t.Fatal(err) |
| 30 | } |
| 31 | c, err := ParseBucketCorsConfig(bytes.NewReader(fileContents)) |
| 32 | if err != nil { |
| 33 | t.Fatal(err) |
| 34 | } |
| 35 | remarshalled, err := c.ToXML() |
| 36 | if err != nil { |
| 37 | t.Fatal(err) |
| 38 | } |
| 39 | trimmedFileContents := bytes.TrimSpace(fileContents) |
| 40 | if !bytes.Equal(trimmedFileContents, remarshalled) { |
| 41 | t.Errorf("got: %s, want: %s", string(remarshalled), string(trimmedFileContents)) |
| 42 | } |
| 43 | } |
nothing calls this directly
no test coverage detected