unit test cases update for package gins

This commit is contained in:
John 2019-03-13 09:11:50 +08:00
parent 218c692fe0
commit 281bae4116
4 changed files with 7 additions and 1 deletions

View File

@ -56,6 +56,7 @@ test = "v=1"
err := gfile.PutContents(path, config)
gtest.Assert(err, nil)
defer gfile.Remove(path)
defer gins.Config().Reload()
gtest.Assert(gins.Config().Get("test"), "v=1")
gtest.Assert(gins.Config().Get("database.default.1.host"), "127.0.0.1")
gtest.Assert(gins.Config().Get("redis.disk"), "127.0.0.1:6379,0")
@ -65,6 +66,7 @@ test = "v=1"
err := gfile.PutContents(path, config)
gtest.Assert(err, nil)
defer gfile.Remove(path)
defer gins.Config().Reload()
gtest.Assert(gins.Config("test.toml").Get("test"), "v=1")
gtest.Assert(gins.Config("test.toml").Get("database.default.1.host"), "127.0.0.1")
gtest.Assert(gins.Config("test.toml").Get("redis.disk"), "127.0.0.1:6379,0")
@ -76,6 +78,7 @@ test = "v=1"
err := gfile.PutContents(file, config)
gtest.Assert(err, nil)
defer gfile.Remove(file)
defer gins.Config().Reload()
gtest.Assert(gins.Config().AddPath(path), nil)
gtest.Assert(gins.Config().Get("test"), "v=1")
gtest.Assert(gins.Config().Get("database.default.1.host"), "127.0.0.1")
@ -87,6 +90,7 @@ test = "v=1"
err := gfile.PutContents(file, config)
gtest.Assert(err, nil)
defer gfile.Remove(file)
defer gins.Config("test.toml").Reload()
gtest.Assert(gins.Config("test.toml").AddPath(path), nil)
gtest.Assert(gins.Config("test.toml").Get("test"), "v=1")
gtest.Assert(gins.Config("test.toml").Get("database.default.1.host"), "127.0.0.1")

View File

@ -51,6 +51,7 @@ test = "v=1"
err := gfile.PutContents(path, config)
gtest.Assert(err, nil)
defer gfile.Remove(path)
defer gins.Config().Reload()
gtest.Case(t, func() {
dbDefault := gins.Database()

View File

@ -51,6 +51,7 @@ test = "v=1"
err := gfile.PutContents(path, config)
gtest.Assert(err, nil)
defer gfile.Remove(path)
defer gins.Config().Reload()
gtest.Case(t, func() {
redisDefault := gins.Redis()

View File

@ -1,3 +1,3 @@
// from golang-1.11.2
// from golang-1.11.2 text/template
// 1. remove "<no value>" when template variable does not exist;
package text