Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyhedral committed Oct 26, 2024
1 parent e0683b4 commit d58c4bd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions util/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ import (
)

func TestGetEnv(t *testing.T) {
os.Setenv("TEST", "value")
value := GetEnv("TEST", "default")
os.Setenv("TGE", "value")
value := GetEnv("TGE", "default")
if value != "value" {
t.Fail()
}
}

func TestGetEnvDefault(t *testing.T) {
value := GetEnv("TEST", "default")
value := GetEnv("TGED", "default")
if value != "default" {
t.Fail()
}
}

func TestGetEnvInt(t *testing.T) {
os.Setenv("TEST", "1234")
value := GetEnvInt("TEST", 5678)
os.Setenv("TGEI", "1234")
value := GetEnvInt("TGEI", 5678)
if value != 1234 {
t.Fail()
}
}

func TestGetEnvIntDefault(t *testing.T) {
value := GetEnvInt("TEST", 5678)
value := GetEnvInt("TGEID", 5678)
if value != 5678 {
t.Fail()
}
Expand Down

0 comments on commit d58c4bd

Please sign in to comment.