Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasjackson committed Oct 9, 2024
1 parent f196489 commit ec44b5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions functions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ func TestParseProcessesDefaultFunctionsWithFile(t *testing.T) {
os.Unsetenv("MYENV")
})

home, _ := os.UserHomeDir()

p := setupParser(t)
c, err := p.ParseFile(absoluteFolderPath)
require.NoError(t, err)
Expand All @@ -184,6 +182,8 @@ func TestParseProcessesDefaultFunctionsWithFile(t *testing.T) {

cont := r.(*structs.Container)

home, _ := os.UserHomeDir()

require.Equal(t, "3", cont.Env["len_string"])
require.Equal(t, "2", cont.Env["len_collection"])
require.Equal(t, "myvalue", cont.Env["env"])
Expand All @@ -210,8 +210,6 @@ func TestParseProcessesDefaultFunctionsWithDirectory(t *testing.T) {
os.Unsetenv("MYENV")
})

home, _ := os.UserHomeDir()

p := setupParser(t)
p.RegisterFunction("constant_number", func() (int, error) { return 42, nil })

Expand All @@ -223,6 +221,8 @@ func TestParseProcessesDefaultFunctionsWithDirectory(t *testing.T) {

cont := r.(*structs.Container)

home, _ := os.UserHomeDir()

require.Equal(t, "3", cont.Env["len_string"])
require.Equal(t, "2", cont.Env["len_collection"])
require.Equal(t, "myvalue", cont.Env["env"])
Expand Down

0 comments on commit ec44b5e

Please sign in to comment.