Skip to content

Commit

Permalink
fix: side effect related to the update of github.com/go-xmlfmt/xmlfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Dec 26, 2022
1 parent e2773dc commit 6060eda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/printers/checkstyle_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//nolint:dupl
package printers

import (
"bytes"
"context"
"go/token"
"strings"
"testing"

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

//nolint:lll
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"
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"

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

0 comments on commit 6060eda

Please sign in to comment.