Config.AddOptions and Generator.MakeWithConfig

This commit is contained in:
Dan Jones 2025-03-18 09:22:30 -05:00
commit 1abfaa44d1
3 changed files with 25 additions and 3 deletions

View file

@ -20,3 +20,12 @@ func TestNewConfWithOpts(t *testing.T) {
assert.Equal(t, "", c.extension)
assert.Equal(t, "foobar", c.prefix)
}
func TestConfAddOpts(t *testing.T) {
c := Config{original: "hi"}
c2 := c.AddOptions(WithOriginalSlug("Hello, my dear"), WithPrefix("yo"))
assert.Equal(t, "", c.prefix)
assert.Equal(t, "hi", c.original)
assert.Equal(t, "hello-my-dear", c2.original)
assert.Equal(t, "yo", c2.prefix)
}