From 281bae4116a0db6b8039f419060b56a54f08c01f Mon Sep 17 00:00:00 2001 From: John Date: Wed, 13 Mar 2019 09:11:50 +0800 Subject: [PATCH] unit test cases update for package gins --- g/frame/gins/gins_config_test.go | 4 ++++ g/frame/gins/gins_database_test.go | 1 + g/frame/gins/gins_redis_test.go | 1 + g/os/gview/internal/text/text.go | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/g/frame/gins/gins_config_test.go b/g/frame/gins/gins_config_test.go index bdc9c67be..9a54f8bde 100644 --- a/g/frame/gins/gins_config_test.go +++ b/g/frame/gins/gins_config_test.go @@ -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") diff --git a/g/frame/gins/gins_database_test.go b/g/frame/gins/gins_database_test.go index 85b949a33..1a2221567 100644 --- a/g/frame/gins/gins_database_test.go +++ b/g/frame/gins/gins_database_test.go @@ -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() diff --git a/g/frame/gins/gins_redis_test.go b/g/frame/gins/gins_redis_test.go index 060e51538..4af79b1e4 100644 --- a/g/frame/gins/gins_redis_test.go +++ b/g/frame/gins/gins_redis_test.go @@ -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() diff --git a/g/os/gview/internal/text/text.go b/g/os/gview/internal/text/text.go index 022b3a513..3206bc935 100644 --- a/g/os/gview/internal/text/text.go +++ b/g/os/gview/internal/text/text.go @@ -1,3 +1,3 @@ -// from golang-1.11.2 +// from golang-1.11.2 text/template // 1. remove "" when template variable does not exist; package text