From 3cc468a82f91714f2da1c62d2e6b54f82e5a7890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 7 Feb 2016 20:14:24 +0100 Subject: [PATCH] tpl: Add missing test variants for slicestr --- tpl/template_funcs_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tpl/template_funcs_test.go b/tpl/template_funcs_test.go index 4ad95b6d2..b52075218 100644 --- a/tpl/template_funcs_test.go +++ b/tpl/template_funcs_test.go @@ -499,6 +499,8 @@ func TestSlicestr(t *testing.T) { {"abcdef", 1, -1, false}, {tstNoStringer{}, 0, 1, false}, {"ĀĀĀ", 0, 1, "Ā"}, // issue #1333 + {"a", t, nil, false}, + {"a", 1, t, false}, } { var result string if this.v2 == nil { @@ -523,6 +525,12 @@ func TestSlicestr(t *testing.T) { } } } + + // Too many arguments + _, err = slicestr("a", 1, 2, 3) + if err == nil { + t.Errorf("Should have errored") + } } func TestSubstr(t *testing.T) {