Fix LogURIGenerator on Windows
Checking / is not the right way to distinguish an absolute path in Windows. Fixes #5786. Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestNewFifoSetInDir_NoTerminal(t *testing.T) {
|
||||
@@ -45,3 +46,19 @@ func TestNewFifoSetInDir_Terminal(t *testing.T) {
|
||||
assert.NotEmpty(t, set.Stdout, "FIFOSet.Stdout should be set")
|
||||
assert.Empty(t, set.Stderr, "FIFOSet.Stderr should not be set")
|
||||
}
|
||||
|
||||
func TestLogFileBackslash(t *testing.T) {
|
||||
testcases := []struct {
|
||||
path string
|
||||
}{
|
||||
{`C:/foo/bar.log`},
|
||||
{`C:\foo\bar.log`},
|
||||
}
|
||||
for _, tc := range testcases {
|
||||
f := LogFile(tc.path)
|
||||
res, err := f("unused")
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, res.Config().Stdout, res.Config().Stderr)
|
||||
assert.Equal(t, "file:///C:/foo/bar.log", res.Config().Stdout)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user