Skip to content

Commit

Permalink
added unit test for env vars
Browse files Browse the repository at this point in the history
Signed-off-by: Bram.Cautaerts <[email protected]>
  • Loading branch information
Bram.Cautaerts committed Sep 28, 2023
1 parent 07b0c74 commit fda6bdb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/venom/run/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ func Test_mergeVariables(t *testing.T) {
}

func Test_initFromEnv(t *testing.T) {
env := []string{`VENOM_VAR_a=1`, `VENOM_VAR_b="B"`, `VENOM_VAR_c=[1,2,3]`}
env := []string{`VENOM_VAR_a=1`, `VENOM_VAR_b="B"`, `VENOM_VAR_c=[1,2,3]`, `VENOM_VAR_d="e=f"`}
found, err := initFromEnv(env)
require.NoError(t, err)
require.Equal(t, 3, len(found))
require.Equal(t, 4, len(found))
var nb int
for i := range found {
if found[i] == "a=1" {
Expand All @@ -102,6 +102,8 @@ func Test_initFromEnv(t *testing.T) {
nb++
} else if found[i] == "c=[1,2,3]" {
nb++
} else if found[i] == "d=e=f" {
nb++
}
}
}

0 comments on commit fda6bdb

Please sign in to comment.