Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix up config test #621

Merged
merged 1 commit into from Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 12 additions & 12 deletions config/config_test.go
Expand Up @@ -28,11 +28,11 @@ func TestJSONMarshalSecret(t *testing.T) {
S Secret
}
for _, tc := range []struct {
desc string
data tmp
expected string
trueValue bool
testYAML bool
desc string
data tmp
expected string
marshalSecret bool
testYAML bool
}{
{
desc: "inhabited",
Expand All @@ -42,18 +42,18 @@ func TestJSONMarshalSecret(t *testing.T) {
expected: "{\"S\":\"\\u003csecret\\u003e\"}",
},
{
desc: "true value in JSON",
data: tmp{"test"},
expected: `{"S":"test"}`,
trueValue: true,
desc: "true value in JSON",
data: tmp{"test"},
expected: `{"S":"test"}`,
marshalSecret: true,
},
{
desc: "true value in YAML",
data: tmp{"test"},
expected: `s: test
`,
trueValue: true,
testYAML: true,
marshalSecret: true,
testYAML: true,
},
{
desc: "empty",
Expand All @@ -62,7 +62,7 @@ func TestJSONMarshalSecret(t *testing.T) {
},
} {
t.Run(tc.desc, func(t *testing.T) {
MarshalSecretValue = tc.trueValue
MarshalSecretValue = tc.marshalSecret

var marshalFN func(any) ([]byte, error)
if tc.testYAML {
Expand Down