You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
427 B

  1. package main
  2. import (
  3. "testing"
  4. log "github.com/sirupsen/logrus"
  5. )
  6. func TestLogInfo(t *testing.T) {
  7. logrusConstant := stringToLogConstant(":info")
  8. if logrusConstant != log.InfoLevel {
  9. t.Errorf("Wrong logrus constant for info")
  10. }
  11. }
  12. func TestLogInvalid(t *testing.T) {
  13. logrusConstant := stringToLogConstant("ziz")
  14. if logrusConstant != log.FatalLevel {
  15. t.Errorf("Unknown strings should return fatal loglevel")
  16. }
  17. }