Add Slug Generator

This commit is contained in:
Dan Jones 2025-03-13 16:58:55 -05:00
commit 1d235af876
8 changed files with 124 additions and 1 deletions

View file

@ -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)
}