rpcserver_test.go 312 B

12345678910111213141516
  1. package internal
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. "github.com/tal-tech/go-zero/core/stat"
  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. }