Skip to content

Commit

Permalink
make fields public (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaeta authored Aug 22, 2024
1 parent 2ab5a77 commit 221e26a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions pkg/test/configSchema.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (
)

type TestCase = struct {
configs map[string]string
isValid bool
message string
Configs map[string]string
IsValid bool
Message string
}

type TestCaseFromExpression = struct {
expression string
isValid bool
message string
Expression string
IsValid bool
Message string
}

func MakeViper(input map[string]string) *viper.Viper {
Expand All @@ -27,7 +27,7 @@ func MakeViper(input map[string]string) *viper.Viper {
return output
}

func exerciseTestCase(
func ExerciseTestCase(
t *testing.T,
configurationSchema field.Configuration,
extraValidationFunction func(*viper.Viper) error,
Expand Down Expand Up @@ -62,13 +62,13 @@ func ExerciseTestCases(
testCases []TestCase,
) {
for _, testCase := range testCases {
t.Run(testCase.message, func(t *testing.T) {
exerciseTestCase(
t.Run(testCase.Message, func(t *testing.T) {
ExerciseTestCase(
t,
configurationSchema,
extraValidationFunction,
testCase.configs,
testCase.isValid,
testCase.Configs,
testCase.IsValid,
)
})
}
Expand All @@ -85,17 +85,17 @@ func ExerciseTestCasesFromExpressions(
testCases []TestCaseFromExpression,
) {
for _, testCase := range testCases {
t.Run(testCase.message, func(t *testing.T) {
values, err := expressionParser(testCase.expression)
t.Run(testCase.Message, func(t *testing.T) {
values, err := expressionParser(testCase.Expression)
if err != nil {
t.Fatal("could not parse flags:", err)
}
exerciseTestCase(
ExerciseTestCase(
t,
configurationSchema,
extraValidationFunction,
values,
testCase.isValid,
testCase.IsValid,
)
})
}
Expand Down

0 comments on commit 221e26a

Please sign in to comment.