Skip to content

Commit d0acebc

Browse files
committed
fix: side effect related to the update of github.com/go-xmlfmt/xmlfmt
1 parent e2773dc commit d0acebc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/printers/checkstyle_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"bytes"
66
"context"
77
"go/token"
8+
"strings"
89
"testing"
910

1011
"github.com/stretchr/testify/assert"
@@ -51,7 +52,7 @@ func TestCheckstyle_Print(t *testing.T) {
5152
require.NoError(t, err)
5253

5354
//nolint:lll
54-
expected := "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\r\n<checkstyle version=\"5.0\">\r\n <file name=\"path/to/filea.go\">\r\n <error column=\"4\" line=\"10\" message=\"some issue\" severity=\"warning\" source=\"linter-a\">\r\n </error>\r\n </file>\r\n <file name=\"path/to/fileb.go\">\r\n <error column=\"9\" line=\"300\" message=\"another issue\" severity=\"error\" source=\"linter-b\">\r\n </error>\r\n </file>\r\n</checkstyle>\n"
55+
expected := "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<checkstyle version=\"5.0\">\n <file name=\"path/to/filea.go\">\n <error column=\"4\" line=\"10\" message=\"some issue\" severity=\"warning\" source=\"linter-a\"></error>\n </file>\n <file name=\"path/to/fileb.go\">\n <error column=\"9\" line=\"300\" message=\"another issue\" severity=\"error\" source=\"linter-b\"></error>\n </file>\n</checkstyle>\n"
5556

56-
assert.Equal(t, expected, buf.String())
57+
assert.Equal(t, expected, strings.ReplaceAll(buf.String(), "\r", ""))
5758
}

0 commit comments

Comments
 (0)