Skip to content

Commit

Permalink
Test for WithEnvVars aliasing
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbourgon committed Jan 1, 2022
1 parent 72c982b commit 67fe963
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ func TestParseBasics(t *testing.T) {
opts: []ff.Option{ff.WithEnvVarPrefix("TEST_PARSE"), ff.WithEnvVarSplit(",")},
want: fftest.Vars{S: " three ", X: []string{"one", " two", " three "}},
},
{
name: "WithEnvVars",
env: map[string]string{"S": "xxx", "F": "9.87"},
opts: []ff.Option{ff.WithEnvVars()},
want: fftest.Vars{S: "xxx", F: 9.87},
},
{
name: "WithEnvVarNoPrefix", // make sure alias works
env: map[string]string{"S": "xxx", "F": "9.87"},
opts: []ff.Option{ff.WithEnvVarNoPrefix()},
want: fftest.Vars{S: "xxx", F: 9.87},
},
} {
t.Run(testcase.name, func(t *testing.T) {
if testcase.file != "" {
Expand Down

0 comments on commit 67fe963

Please sign in to comment.