repr_test.go 288 B

1234567891011121314
  1. package timex
  2. import (
  3. "testing"
  4. "time"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestReprOfDuration(t *testing.T) {
  8. assert.Equal(t, "1000.0ms", ReprOfDuration(time.Second))
  9. assert.Equal(t, "1111.6ms", ReprOfDuration(
  10. time.Second+time.Millisecond*111+time.Microsecond*555))
  11. }