rpcserver_test.go 309 B

12345678910111213141516
  1. package internal
  2. import (
  3. "testing"
  4. "git.i2edu.net/i2/go-zero/core/stat"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestWithMetrics(t *testing.T) {
  8. metrics := stat.NewMetrics("foo")
  9. opt := WithMetrics(metrics)
  10. var options rpcServerOptions
  11. opt(&options)
  12. assert.Equal(t, metrics, options.metrics)
  13. }