2025-03-10 14:52:50 -05:00
|
|
|
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)
|
2025-03-13 15:36:30 -05:00
|
|
|
st, _ := c.generator(&c)
|
2025-03-10 14:52:50 -05:00
|
|
|
_, parseErr := uuid.Parse(st)
|
|
|
|
|
assert.NoError(t, parseErr)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestNewConfWithOpts(t *testing.T) {
|
|
|
|
|
c := NewConfig(WithoutExtension(), WithPrefix("foobar"))
|
|
|
|
|
assert.Equal(t, "", c.extension)
|
2025-03-11 16:42:39 -05:00
|
|
|
assert.Equal(t, "foobar", c.prefix)
|
2025-03-10 14:52:50 -05:00
|
|
|
}
|