Skip to content

Commit

Permalink
add test for wildcard at the start
Browse files Browse the repository at this point in the history
  • Loading branch information
lovromazgon committed Apr 15, 2024
1 parent 3d53547 commit f78d5d6
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,8 @@ func TestBreakUpConfig_Conflict_Value(t *testing.T) {

func TestConfig_getValuesForParameter(t *testing.T) {
cfg := Config{
"ignore": "me",
"ignore": "me",
"ignore.foo.this": "me",

// foo
"test.foo.val": "0",
Expand Down Expand Up @@ -1001,6 +1002,34 @@ func TestConfig_getValuesForParameter(t *testing.T) {
"test.bar.format.baz.options",
"test.bar.format.qux.options",
},
}, {
key: "*",
want: []string{
"ignore",
"ignore.foo.this",
"test.foo.val",
"test.foo.format.baz.type",
"test.foo.format.baz.options",
"test.foo.format.qux.type",
"test.foo.format.qux.options",
"test.bar.val",
"test.bar.format.baz.type",
"test.bar.format.baz.options",
"test.bar.format.qux.type",
"test.bar.format.qux.options",
"test.include.me",
"test.ignore",
},
}, {
key: "*.foo.*",
want: []string{
"ignore.foo.this",
"test.foo.val",
"test.foo.format.baz.type",
"test.foo.format.baz.options",
"test.foo.format.qux.type",
"test.foo.format.qux.options",
},
}}

for _, tc := range testCases {
Expand Down

0 comments on commit f78d5d6

Please sign in to comment.