lint: convert snake to camel case
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func TestFailureCases(t *testing.T) {
|
||||
test_cases := []struct {
|
||||
testCases := []struct {
|
||||
sqlFile string
|
||||
expectedFailures []string
|
||||
}{
|
||||
@@ -34,24 +34,24 @@ func TestFailureCases(t *testing.T) {
|
||||
}},
|
||||
}
|
||||
|
||||
for _, test_case := range test_cases {
|
||||
t.Run(test_case.sqlFile, func(t *testing.T) {
|
||||
schema, err := schema.SchemaFromSQLFile(test_case.sqlFile)
|
||||
for _, testCase := range testCases {
|
||||
t.Run(testCase.sqlFile, func(t *testing.T) {
|
||||
schema, err := schema.SchemaFromSQLFile(testCase.sqlFile)
|
||||
require.NoError(t, err)
|
||||
|
||||
for _, check := range lint.Checks {
|
||||
results := check.Execute(schema)
|
||||
|
||||
is_failure := len(results) > 0
|
||||
is_failure_expected := slices.Contains(test_case.expectedFailures, check.Name)
|
||||
isFailure := len(results) > 0
|
||||
isFailureExpected := slices.Contains(testCase.expectedFailures, check.Name)
|
||||
|
||||
if is_failure != is_failure_expected {
|
||||
if is_failure_expected {
|
||||
t.Errorf("Expected check '%s' to fail, but it passed: %s", check.Name, test_case.sqlFile)
|
||||
if isFailure != isFailureExpected {
|
||||
if isFailureExpected {
|
||||
t.Errorf("Expected check '%s' to fail, but it passed: %s", check.Name, testCase.sqlFile)
|
||||
} else {
|
||||
t.Errorf("Expected check '%s' to pass, but it failed: %s (%q.%q)",
|
||||
check.Name,
|
||||
test_case.sqlFile,
|
||||
testCase.sqlFile,
|
||||
results[0].TableName, results[0].ColumnName,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user