✨ Add Slug Generator
This commit is contained in:
parent
921020d9fd
commit
1d235af876
8 changed files with 124 additions and 1 deletions
12
make_test.go
12
make_test.go
|
|
@ -52,3 +52,15 @@ func TestMakeErr(t *testing.T) {
|
|||
assert.Zero(t, st)
|
||||
assert.ErrorIs(t, err, retErr)
|
||||
}
|
||||
|
||||
func TestMakeDoesntChangeConf(t *testing.T) {
|
||||
gen := func(c *Config) (string, error) {
|
||||
c.original = ""
|
||||
return "foo", nil
|
||||
}
|
||||
conf := NewConfig(WithGenerator(gen), WithOriginal("foobar"))
|
||||
st, err := Make(conf)
|
||||
assert.Equal(t, "foobar", conf.original)
|
||||
assert.Equal(t, "foo.txt", st)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue