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
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

run_proxy_test.go 758B

12345678910111213141516171819202122232425262728293031
  1. package cli
  2. import (
  3. "testing"
  4. "time"
  5. "github.com/rs/zerolog"
  6. "github.com/stretchr/testify/require"
  7. )
  8. func TestLogTimeFormat(t *testing.T) {
  9. cases := []struct {
  10. value string
  11. want string
  12. }{
  13. {value: "", want: zerolog.TimeFormatUnixMs},
  14. {value: "unix-ms", want: zerolog.TimeFormatUnixMs},
  15. {value: "unix", want: zerolog.TimeFormatUnix},
  16. {value: "unix-micro", want: zerolog.TimeFormatUnixMicro},
  17. {value: "unix-nano", want: zerolog.TimeFormatUnixNano},
  18. {value: "rfc3339", want: time.RFC3339},
  19. {value: "rfc3339-nano", want: time.RFC3339Nano},
  20. {value: "2006-01-02 15:04:05", want: "2006-01-02 15:04:05"},
  21. }
  22. for _, c := range cases {
  23. t.Run(c.value, func(t *testing.T) {
  24. require.Equal(t, c.want, logTimeFormat(c.value))
  25. })
  26. }
  27. }