Skip to content

Commit

Permalink
add path test (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladopajic authored Nov 17, 2024
1 parent 34a0930 commit 91a55de
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions pkg/testcoverage/path/path_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package path_test

import (
"runtime"
"testing"

. "github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/path"

"github.com/stretchr/testify/assert"
)

func Test_NormalizeForOS(t *testing.T) {
t.Parallel()

if runtime.GOOS == "windows" {
assert.Equal(t, "foo\\bar", NormalizeForOS("foo/bar"))
} else {
assert.Equal(t, "foo/bar", NormalizeForOS("foo/bar"))
}
}

func Test_NormalizeForTool(t *testing.T) {
t.Parallel()

if runtime.GOOS == "windows" {
assert.Equal(t, "foo/bar", NormalizeForTool("foo\\bar"))
} else {
assert.Equal(t, "foo/bar", NormalizeForTool("foo/bar"))
}
}

0 comments on commit 91a55de

Please sign in to comment.