shithub: hugo

Download patch

ref: 3cc468a82f91714f2da1c62d2e6b54f82e5a7890
parent: 05c8bccf84624d3905258c32c8f258bc9eb315c5
author: Bjørn Erik Pedersen <[email protected]>
date: Sun Feb 7 15:14:24 EST 2016

tpl: Add missing test variants for slicestr

--- a/tpl/template_funcs_test.go
+++ b/tpl/template_funcs_test.go
@@ -499,6 +499,8 @@
 		{"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 {
@@ -522,6 +524,12 @@
 				t.Errorf("[%d] got %s but expected %s", i, result, this.expect)
 			}
 		}
+	}
+
+	// Too many arguments
+	_, err = slicestr("a", 1, 2, 3)
+	if err == nil {
+		t.Errorf("Should have errored")
 	}
 }