✨ Add separator option
This commit is contained in:
parent
84994d3b73
commit
4b509d31bb
6 changed files with 37 additions and 8 deletions
|
|
@ -10,21 +10,21 @@ func TestWithOriginal(t *testing.T) {
|
|||
var c Config
|
||||
name := "foobar"
|
||||
WithOriginal(name)(&c)
|
||||
assert.Equal(t, "_"+name, c.original)
|
||||
assert.Equal(t, name, c.original)
|
||||
}
|
||||
|
||||
func TestWithPrefix(t *testing.T) {
|
||||
var c Config
|
||||
pref := "draft"
|
||||
WithPrefix(pref)(&c)
|
||||
assert.Equal(t, pref+"_", c.prefix)
|
||||
assert.Equal(t, pref, c.prefix)
|
||||
}
|
||||
|
||||
func TestWithSuffix(t *testing.T) {
|
||||
var c Config
|
||||
suff := "out"
|
||||
WithSuffix(suff)(&c)
|
||||
assert.Equal(t, "_"+suff, c.suffix)
|
||||
assert.Equal(t, suff, c.suffix)
|
||||
}
|
||||
|
||||
func TestWithoutExtension(t *testing.T) {
|
||||
|
|
@ -39,3 +39,10 @@ func TestWithExtension(t *testing.T) {
|
|||
WithExtension(ext)(&c)
|
||||
assert.Equal(t, "."+ext, c.extension)
|
||||
}
|
||||
|
||||
func TestWithSeparator(t *testing.T) {
|
||||
var c Config
|
||||
sep := "---"
|
||||
WithSeparator(sep)(&c)
|
||||
assert.Equal(t, sep, c.separator)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue