File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,10 @@ package sprig
22
33import (
44 "fmt"
5- "github.com/stretchr/testify/assert"
65 "strconv"
76 "testing"
7+
8+ "github.com/stretchr/testify/assert"
89)
910
1011func TestUntil (t * testing.T ) {
@@ -249,6 +250,13 @@ func TestDivf(t *testing.T) {
249250 }
250251}
251252
253+ func TestMod (t * testing.T ) {
254+ tpl := `{{ mod 7 2 }}`
255+ if err := runt (tpl , `1` ); err != nil {
256+ t .Error (err )
257+ }
258+ }
259+
252260func TestMul (t * testing.T ) {
253261 tpl := `{{ 1 | mul "2" 3 "4"}}`
254262 if err := runt (tpl , `24` ); err != nil {
Original file line number Diff line number Diff line change @@ -297,3 +297,17 @@ func TestPlural(t *testing.T) {
297297 t .Error (err )
298298 }
299299}
300+
301+ func TestRepeat (t * testing.T ) {
302+ tpl := `{{ "foo" | repeat 5 }}`
303+ if err := runt (tpl , "foofoofoofoofoo" ); err != nil {
304+ t .Error (err )
305+ }
306+ }
307+
308+ func TestSplitList (t * testing.T ) {
309+ tpl := `{{ splitList "$" "foo$bar$baz" }}`
310+ if err := runt (tpl , "[foo bar baz]" ); err != nil {
311+ t .Error (err )
312+ }
313+ }
You can’t perform that action at this time.
0 commit comments