22 lines
452 B
Go
22 lines
452 B
Go
package nomino
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestNewConf(t *testing.T) {
|
|
c := NewConfig()
|
|
assert.Equal(t, ".txt", c.extension)
|
|
st, _ := c.generator()
|
|
_, parseErr := uuid.Parse(st)
|
|
assert.NoError(t, parseErr)
|
|
}
|
|
|
|
func TestNewConfWithOpts(t *testing.T) {
|
|
c := NewConfig(WithoutExtension(), WithPrefix("foobar"))
|
|
assert.Equal(t, "", c.extension)
|
|
assert.Equal(t, "foobar", c.prefix)
|
|
}
|