diff options
author | bodqhrohro <bodqhrohro@gmail.com> | 2019-11-12 21:02:06 +0300 |
---|---|---|
committer | bodqhrohro <bodqhrohro@gmail.com> | 2019-11-12 21:02:06 +0300 |
commit | 47cf94ad01b4db8749c55c1a1dca50c9b94daf02 (patch) | |
tree | 7dcb58d95f2ebf3614413d95f6d6658019286b20 /log_test.go | |
parent | a5c97d68e77ca8c9c5518051f085051487cd0fbf (diff) |
Tests for log constants
Diffstat (limited to 'log_test.go')
-rw-r--r-- | log_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/log_test.go b/log_test.go new file mode 100644 index 0000000..906c6dc --- /dev/null +++ b/log_test.go @@ -0,0 +1,21 @@ +package main + +import ( + "testing" + + log "github.com/sirupsen/logrus" +) + +func TestLogInfo(t *testing.T) { + logrusConstant := stringToLogConstant(":info") + if logrusConstant != log.InfoLevel { + t.Errorf("Wrong logrus constant for info") + } +} + +func TestLogInvalid(t *testing.T) { + logrusConstant := stringToLogConstant("ziz") + if logrusConstant != log.FatalLevel { + t.Errorf("Unknown strings should return fatal loglevel") + } +} |