Browse Source

test(file): improve

database-migration-cmd
Geno 1 year ago
parent
commit
95b99107f5
  1. 15
      file/toml_test.go

15
file/toml_test.go

@ -8,6 +8,21 @@ import (
"github.com/stretchr/testify/assert"
)
func TestTOMLDuration(t *testing.T) {
assert := assert.New(t)
var d TOMLDuration
err := d.UnmarshalText([]byte("5m"))
assert.NoError(err)
err = d.UnmarshalText([]byte("5z"))
assert.Error(err)
txt, err := d.MarshalText()
assert.NoError(err)
assert.Equal("5m0s", string(txt))
}
func TestReadTOML(t *testing.T) {
assert := assert.New(t)

Loading…
Cancel
Save