Skip to content

Commit

Permalink
fix envutil tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Equanox committed Dec 29, 2022
1 parent 00d98c4 commit 3110ecd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
7 changes: 7 additions & 0 deletions pkg/envutil/envhash.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package envutil

type Hash string

func (h *Hash) String() string {
return string(*h)
}
2 changes: 0 additions & 2 deletions pkg/envutil/envutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ func Merge(a []string, b []string) []string {
return r
}

println("herererr")

for _, v := range b {
pair := strings.SplitN(v, "=", 2)
envKeys[pair[0]] = v
Expand Down
6 changes: 5 additions & 1 deletion pkg/envutil/envutil_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package envutil

import (
"sort"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -37,6 +38,9 @@ func TestMergeEnv(t *testing.T) {

for _, tc := range tests {
t.Log(tc.description)
assert.Equal(t, tc.expectedResult, Merge(tc.first, tc.second))
sort.Strings(tc.expectedResult)
result := Merge(tc.first, tc.second)
sort.Strings(result)
assert.Equal(t, tc.expectedResult, result)
}
}
7 changes: 7 additions & 0 deletions pkg/envutil/store.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package envutil

type Store map[Hash][]string

func NewStore() Store {
return make(Store)
}

0 comments on commit 3110ecd

Please sign in to comment.