options_test.go 373 B

123456789101112131415161718
  1. package mon
  2. import (
  3. "testing"
  4. "time"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestSetSlowThreshold(t *testing.T) {
  8. assert.Equal(t, defaultSlowThreshold, slowThreshold.Load())
  9. SetSlowThreshold(time.Second)
  10. assert.Equal(t, time.Second, slowThreshold.Load())
  11. }
  12. func TestDefaultOptions(t *testing.T) {
  13. assert.Equal(t, defaultTimeout, defaultOptions().timeout)
  14. }