hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 3cc468a82f91714f2da1c62d2e6b54f82e5a7890
parent 05c8bccf84624d3905258c32c8f258bc9eb315c5
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Sun,  7 Feb 2016 20:14:24 +0100

tpl: Add missing test variants for slicestr

Diffstat:
Mtpl/template_funcs_test.go | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git 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) {