Skip to content

Commit 6060eda

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

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/printers/checkstyle_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//nolint:dupl
21
package printers
32

43
import (
54
"bytes"
65
"context"
76
"go/token"
7+
"strings"
88
"testing"
99

1010
"github.com/stretchr/testify/assert"
@@ -51,7 +51,7 @@ func TestCheckstyle_Print(t *testing.T) {
5151
require.NoError(t, err)
5252

5353
//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"
54+
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"
5555

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

0 commit comments

Comments
 (0)