golangci-lint/test/testshared/directives_test.go
2022-08-15 21:56:32 +02:00

21 lines
436 B
Go

package testshared
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestParseTestDirectives(t *testing.T) {
rc := ParseTestDirectives(t, "./testdata/all.go")
require.NotNil(t, rc)
expected := &RunContext{
Args: []string{"-Efoo", "--simple", "--hello=world"},
ConfigPath: "testdata/example.yml",
ExpectedLinter: "bar",
}
assert.Equal(t, expected, rc)
}