mirror of
https://gitee.com/johng/gf.git
synced 2024-11-30 11:18:02 +08:00
添加 genv 测试
This commit is contained in:
parent
d5d14b7efc
commit
b0b6871bbb
36
g/os/genv/genv_test.go
Normal file
36
g/os/genv/genv_test.go
Normal file
@ -0,0 +1,36 @@
|
||||
package genv_test
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/g/os/genv"
|
||||
"github.com/gogf/gf/g/test/gtest"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Test_Genv_All(t *testing.T) {
|
||||
gtest.Case(t, func() {
|
||||
gtest.Assert(os.Environ(), genv.All())
|
||||
})
|
||||
}
|
||||
|
||||
func Test_Genv_Get(t *testing.T) {
|
||||
gtest.Case(t, func() {
|
||||
gtest.AssertEQ("keke", genv.Get("LLL"+time.Now().String(), "keke"))
|
||||
gtest.AssertEQ("", genv.Get("LLL"+time.Now().String()))
|
||||
})
|
||||
}
|
||||
|
||||
func Test_Genv_Set(t *testing.T) {
|
||||
gtest.Case(t, func() {
|
||||
err := genv.Set("LLL", "keke")
|
||||
gtest.Assert(err, nil)
|
||||
})
|
||||
}
|
||||
|
||||
func Test_Genv_Remove(t *testing.T) {
|
||||
gtest.Case(t, func() {
|
||||
err := genv.Remove("LLL")
|
||||
gtest.Assert(err, nil)
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue
Block a user