Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

noop_test.go 970B

1234567891011121314151617181920212223242526272829303132333435
  1. package logger_test
  2. import (
  3. "io"
  4. "testing"
  5. "github.com/9seconds/mtg/v2/internal/testlib"
  6. "github.com/9seconds/mtg/v2/logger"
  7. "github.com/stretchr/testify/suite"
  8. )
  9. type NoopLoggerTestSuite struct {
  10. suite.Suite
  11. }
  12. func (suite *NoopLoggerTestSuite) TestLog() {
  13. suite.Empty(testlib.CaptureStdout(func() {
  14. suite.Empty(testlib.CaptureStderr(func() {
  15. log := logger.NewNoopLogger().Named("name")
  16. log.BindInt("int", 1).BindStr("str", "1").Printf("info", 1, 2)
  17. log.BindInt("int", 1).BindStr("str", "1").Info("info")
  18. log.BindInt("int", 1).BindStr("str", "1").Warning("info")
  19. log.BindInt("int", 1).BindStr("str", "1").Debug("info")
  20. log.BindInt("int", 1).BindStr("str", "1").InfoError("info", io.EOF)
  21. log.BindInt("int", 1).BindStr("str", "1").WarningError("info", io.EOF)
  22. log.BindInt("int", 1).BindStr("str", "1").DebugError("info", io.EOF)
  23. }))
  24. }))
  25. }
  26. func TestNoopLogger(t *testing.T) {
  27. t.Parallel()
  28. suite.Run(t, &NoopLoggerTestSuite{})
  29. }