mirror of
https://github.com/datarhei/core.git
synced 2025-11-03 10:30:53 +08:00
Merge branch 'dev' into vod
This commit is contained in:
@@ -58,6 +58,20 @@ func TestReplace(t *testing.T) {
|
||||
require.Equal(t, "", replaced)
|
||||
}
|
||||
|
||||
func TestReplaceInvalid(t *testing.T) {
|
||||
r := New()
|
||||
r.RegisterReplaceFunc(
|
||||
"foo:bar",
|
||||
func(params map[string]string, config *app.Config, section string) string {
|
||||
return "Hello " + params["who"] + "! " + params["what"] + "?"
|
||||
},
|
||||
nil,
|
||||
)
|
||||
|
||||
replaced := r.Replace("{foo:bar, who=World}", "foo:bar", "", nil, nil, "")
|
||||
require.Equal(t, "Hello World! defaultWhat?", replaced)
|
||||
}
|
||||
|
||||
func TestReplacerFunc(t *testing.T) {
|
||||
r := New()
|
||||
r.RegisterReplaceFunc(
|
||||
|
||||
Reference in New Issue
Block a user