Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Oct 21, 2022
1 parent 6f2b029 commit a0e1731
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions pkg/setup/detect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,21 @@ func tempYAML(t *testing.T, content string) string {
func TestPathExists(t *testing.T) {
t.Parallel()

tests := []struct {
type test struct {
path string
expected bool
}{
{"/boot", true},
{"/tmp", true},
}

tests := []test{
{"/this-should-not-exist", false},
}

if runtime.GOOS == "windows" {
tests = append(tests, test{`C:\`, true})
} else {
tests = append(tests, test{"/tmp", true})
}

for _, tc := range tests {
tc := tc
env := setup.NewExprEnvironment(setup.DetectOptions{}, setup.ExprOS{})
Expand Down Expand Up @@ -970,7 +976,7 @@ func TestDetectDatasourceValidation(t *testing.T) {
datasource:
source: wineventlog`,
expected: setup.Setup{Setup:[]setup.ServiceSetup{}},
expectedErr: "",
expectedErr: "invalid datasource for foobar: event_channel or xpath_query must be set",
})
}

Expand Down

0 comments on commit a0e1731

Please sign in to comment.