Add extra Options to Make

This commit is contained in:
Dan Jones 2025-03-14 21:46:30 -05:00
commit db2f12522d
3 changed files with 42 additions and 4 deletions

View file

@ -66,3 +66,18 @@ func TestMakeDoesntChangeConf(t *testing.T) {
assert.Equal(t, "foo.txt", st)
assert.NoError(t, err)
}
func TestMakeOptsDoesntChangeConf(t *testing.T) {
gen := Incremental()
conf := NewConfig(WithGenerator(gen), WithPrefix("pre"))
st, err := Make(conf, WithOriginal("foobar"))
assert.Equal(t, "", conf.original)
assert.Equal(t, "pre_0_foobar.txt", st)
assert.NoError(t, err)
st, err = Make(conf, WithOriginal("baz"))
assert.Equal(t, "", conf.original)
assert.Equal(t, "pre_1_baz.txt", st)
assert.NoError(t, err)
}