Skip to content

Commit

Permalink
fix windows test
Browse files Browse the repository at this point in the history
  • Loading branch information
RobiNino committed Jul 30, 2024
1 parent 7a8764a commit 2e8edb2
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package commandssummaries

import (
buildinfo "github.com/jfrog/build-info-go/entities"
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
"github.com/stretchr/testify/assert"
"os"
"path/filepath"
"strings"
"testing"
)

Expand Down Expand Up @@ -70,7 +72,11 @@ func getTestDataFile(t *testing.T, fileName string) string {
modulesPath := filepath.Join(".", "testdata", fileName)
content, err := os.ReadFile(modulesPath)
assert.NoError(t, err)
return string(content)
contentStr := string(content)
if coreutils.IsWindows() {
strings.ReplaceAll(contentStr, "\\r\\n", "\\n")

Check failure on line 77 in artifactory/commands/commandssummaries/buildinfosummary_test.go

View workflow job for this annotation

GitHub Actions / Static-Check

SA4017: ReplaceAll doesn't have side effects and its return value is ignored (staticcheck)
}
return contentStr
}

func TestParseBuildTime(t *testing.T) {
Expand Down

0 comments on commit 2e8edb2

Please sign in to comment.