time_test.go 367 B

123456789101112131415
  1. package timeutil
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestSecondsToTime(t *testing.T) {
  7. assert.Equal(t, "00:00:12", SecondsToTime(12))
  8. assert.Equal(t, "00:01:00", SecondsToTime(60))
  9. assert.Equal(t, "00:30:00", SecondsToTime(1800))
  10. assert.Equal(t, "01:00:01", SecondsToTime(3601))
  11. assert.Equal(t, "01:30:01", SecondsToTime(5401))
  12. }