diff options
author | bodqhrohro <bodqhrohro@gmail.com> | 2019-10-22 22:55:43 +0300 |
---|---|---|
committer | bodqhrohro <bodqhrohro@gmail.com> | 2019-10-22 22:56:11 +0300 |
commit | 72c9dac62cb6282841d22d877852bcee26bff9dd (patch) | |
tree | 772c3bc19f4461f6ffd427a61476c53b8b75158d /config/config_test.go | |
parent | 9b4a09677a352d9938e4505bfc2d0c8d304567ac (diff) |
Add tests for config package (failing for now)
Diffstat (limited to 'config/config_test.go')
-rw-r--r-- | config/config_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/config/config_test.go b/config/config_test.go new file mode 100644 index 0000000..34009d7 --- /dev/null +++ b/config/config_test.go @@ -0,0 +1,26 @@ +package config + +import ( + "testing" +) + +func TestNoConfig(t *testing.T) { + _, err := ReadConfig("../test/sfklase.yml") + if err == nil { + t.Errorf("Non-existent config was successfully read") + } +} + +func TestGoodConfig(t *testing.T) { + _, err := ReadConfig("../test/good_config.yml") + if err != nil { + t.Errorf("Good config is not accepted: %v", err) + } +} + +func TestBadConfig(t *testing.T) { + _, err := ReadConfig("../test/bad_config.yml") + if err == nil { + t.Errorf("Bad config is accepted but it shoudn't!") + } +} |