diff --git a/numeric_test.go b/numeric_test.go index 1252cd7..d571ec7 100644 --- a/numeric_test.go +++ b/numeric_test.go @@ -2,9 +2,10 @@ package sprig import ( "fmt" - "github.com/stretchr/testify/assert" "strconv" "testing" + + "github.com/stretchr/testify/assert" ) func TestUntil(t *testing.T) { @@ -249,6 +250,13 @@ func TestDivf(t *testing.T) { } } +func TestMod(t *testing.T) { + tpl := `{{ mod 7 2 }}` + if err := runt(tpl, `1`); err != nil { + t.Error(err) + } +} + func TestMul(t *testing.T) { tpl := `{{ 1 | mul "2" 3 "4"}}` if err := runt(tpl, `24`); err != nil { diff --git a/strings_test.go b/strings_test.go index 28b9a1e..5694b02 100644 --- a/strings_test.go +++ b/strings_test.go @@ -297,3 +297,17 @@ func TestPlural(t *testing.T) { t.Error(err) } } + +func TestRepeat(t *testing.T) { + tpl := `{{ "foo" | repeat 5 }}` + if err := runt(tpl, "foofoofoofoofoo"); err != nil { + t.Error(err) + } +} + +func TestSplitList(t *testing.T) { + tpl := `{{ splitList "$" "foo$bar$baz" }}` + if err := runt(tpl, "[foo bar baz]"); err != nil { + t.Error(err) + } +}