Skip to content

Commit

Permalink
remove assert, and make naming constitent
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-perugini committed Jun 18, 2024
1 parent 651c32e commit 6f46e00
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions internal/go-configmap/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"testing"

"github.com/arduino/arduino-cli/internal/go-configmap"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
)
Expand Down Expand Up @@ -82,12 +81,12 @@ func TestApplyEnvVars(t *testing.T) {
c.Set("answer", 42)
c.Set("array", []string{})
c.InjectEnvVars([]string{"APP_FOO=app-bar", "APP_FOOZ_BAR=app-baz"}, "APP")
assert.Equal(t, "app-bar", c.Get("foo"))
assert.Equal(t, "app-baz", c.Get("fooz.bar"))
assert.Equal(t, 42, c.Get("answer"))
require.Equal(t, "app-bar", c.Get("foo"))
require.Equal(t, "app-baz", c.Get("fooz.bar"))
require.Equal(t, 42, c.Get("answer"))

c.InjectEnvVars([]string{"APP_ARRAY=element1 element2 element3"}, "APP")
require.Equal(t, []string{"element1", "element2", "element3"}, c.GetStringSlice("array"))
c.InjectEnvVars([]string{"APP_ARRAY=e1 e2 e3"}, "APP")
require.Equal(t, []string{"e1", "e2", "e3"}, c.GetStringSlice("array"))

// Test env containing array values with typed schema
{
Expand Down

0 comments on commit 6f46e00

Please sign in to comment.