Skip to content

Commit c1b9b72

Browse files
authored
Fix up config test (#621)
Make code more readable by replacing overly generic `trueValue` with the actual meaning `marshalSecret`. Fixes: #487 Signed-off-by: SuperQ <[email protected]>
1 parent de5ed88 commit c1b9b72

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

config/config_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ func TestJSONMarshalSecret(t *testing.T) {
2828
S Secret
2929
}
3030
for _, tc := range []struct {
31-
desc string
32-
data tmp
33-
expected string
34-
trueValue bool
35-
testYAML bool
31+
desc string
32+
data tmp
33+
expected string
34+
marshalSecret bool
35+
testYAML bool
3636
}{
3737
{
3838
desc: "inhabited",
@@ -42,18 +42,18 @@ func TestJSONMarshalSecret(t *testing.T) {
4242
expected: "{\"S\":\"\\u003csecret\\u003e\"}",
4343
},
4444
{
45-
desc: "true value in JSON",
46-
data: tmp{"test"},
47-
expected: `{"S":"test"}`,
48-
trueValue: true,
45+
desc: "true value in JSON",
46+
data: tmp{"test"},
47+
expected: `{"S":"test"}`,
48+
marshalSecret: true,
4949
},
5050
{
5151
desc: "true value in YAML",
5252
data: tmp{"test"},
5353
expected: `s: test
5454
`,
55-
trueValue: true,
56-
testYAML: true,
55+
marshalSecret: true,
56+
testYAML: true,
5757
},
5858
{
5959
desc: "empty",
@@ -62,7 +62,7 @@ func TestJSONMarshalSecret(t *testing.T) {
6262
},
6363
} {
6464
t.Run(tc.desc, func(t *testing.T) {
65-
MarshalSecretValue = tc.trueValue
65+
MarshalSecretValue = tc.marshalSecret
6666

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

0 commit comments

Comments
 (0)