mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
tpl: Add missing test variants for slicestr
This commit is contained in:
parent
05c8bccf84
commit
3cc468a82f
1 changed files with 8 additions and 0 deletions
|
@ -499,6 +499,8 @@ func TestSlicestr(t *testing.T) {
|
||||||
{"abcdef", 1, -1, false},
|
{"abcdef", 1, -1, false},
|
||||||
{tstNoStringer{}, 0, 1, false},
|
{tstNoStringer{}, 0, 1, false},
|
||||||
{"ĀĀĀ", 0, 1, "Ā"}, // issue #1333
|
{"ĀĀĀ", 0, 1, "Ā"}, // issue #1333
|
||||||
|
{"a", t, nil, false},
|
||||||
|
{"a", 1, t, false},
|
||||||
} {
|
} {
|
||||||
var result string
|
var result string
|
||||||
if this.v2 == nil {
|
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) {
|
func TestSubstr(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue