From 5f06e58a09c21e8016197fc8eefc38a86e9eb3e7 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Sun, 9 Jun 2019 03:12:04 -0400 Subject: config init test --- svc/conf_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 svc/conf_test.go (limited to 'svc') diff --git a/svc/conf_test.go b/svc/conf_test.go new file mode 100644 index 0000000..37e64a6 --- /dev/null +++ b/svc/conf_test.go @@ -0,0 +1,22 @@ +package svc + +import ( + "reflect" + "testing" +) + +func Test_initConfig(t *testing.T) { + t.Run("Testing Configuration Initialization", func(t *testing.T) { + + initConfig() + confObj.Mu.RLock() + cnf := reflect.Indirect(reflect.ValueOf(confObj)) + confObj.Mu.RUnlock() + + for i := 0; i < cnf.NumField(); i++ { + if !cnf.Field(i).IsValid() { + t.Errorf("Uninitialized value: %v\n", cnf.Field(i).Type()) + } + } + }) +} -- cgit 1.4.1-2-gfad0