github.com/sandwich-go/boost@v1.3.29/xos/env_test.go (about) 1 package xos 2 3 import ( 4 . "github.com/smartystreets/goconvey/convey" 5 "os" 6 "testing" 7 ) 8 9 func TestEnv(t *testing.T) { 10 Convey("env", t, func() { 11 var envName, envValue string 12 So(os.Setenv(envName, envValue), ShouldNotBeNil) 13 envName, envValue = "a", "b" 14 So(os.Setenv(envName, envValue), ShouldBeNil) 15 16 So(EnvGet(envName), ShouldEqual, envValue) 17 So(EnvGet(envName+"1", envValue), ShouldEqual, envValue) 18 }) 19 }