|
|
@@ -6,9 +6,9 @@ |
|
|
|
package cast |
|
|
|
|
|
|
|
import ( |
|
|
|
"testing" |
|
|
|
|
|
|
|
"html/template" |
|
|
|
"testing" |
|
|
|
"time" |
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert" |
|
|
|
) |
|
|
@@ -151,3 +151,12 @@ func TestIndirectPointers(t *testing.T) { |
|
|
|
assert.Equal(t, ToInt(y), 13) |
|
|
|
assert.Equal(t, ToInt(z), 13) |
|
|
|
} |
|
|
|
|
|
|
|
func TestToDuration(t *testing.T) { |
|
|
|
a := time.Second * 5 |
|
|
|
ai := int64(a) |
|
|
|
b := time.Second * 5 |
|
|
|
bf := float64(b) |
|
|
|
assert.Equal(t, ToDuration(ai), a) |
|
|
|
assert.Equal(t, ToDuration(bf), b) |
|
|
|
} |