Skip to content

Commit

Permalink
replace window line b reak with linux
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoCaso committed Nov 28, 2023
1 parent b496540 commit 61fc133
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/status/render/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package render

import (
"os"
"strings"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -34,7 +35,12 @@ func TestFormatStatus(t *testing.T) {
t.Run("no render errors", func(t *testing.T) {
actual, err := FormatStatus(agentJSON)
require.NoError(t, err)
assert.Equal(t, actual, string(agentText))

// We replace windows line break by linux so the tests pass on every OS
result := strings.Replace(string(agentText), "\r\n", "\n", -1)
actual = strings.Replace(actual, "\r\n", "\n", -1)

assert.Equal(t, actual, result)
assert.NotContains(t, actual, statusRenderErrors)
})
}

0 comments on commit 61fc133

Please sign in to comment.