mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
tpl: Add missing test scenario for strings.Substr
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
4d2b6fc4c0
commit
788e50ad3a
@@ -453,6 +453,7 @@ func TestSubstr(t *testing.T) {
|
|||||||
{"abcdef", 2, -1, "cde"},
|
{"abcdef", 2, -1, "cde"},
|
||||||
{"abcdef", 4, -4, false},
|
{"abcdef", 4, -4, false},
|
||||||
{"abcdef", 7, 1, false},
|
{"abcdef", 7, 1, false},
|
||||||
|
{"abcdef", 6, nil, false},
|
||||||
{"abcdef", 1, 100, "bcdef"},
|
{"abcdef", 1, 100, "bcdef"},
|
||||||
{"abcdef", -100, 3, "abc"},
|
{"abcdef", -100, 3, "abc"},
|
||||||
{"abcdef", -3, -1, "de"},
|
{"abcdef", -3, -1, "de"},
|
||||||
@@ -486,7 +487,7 @@ func TestSubstr(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if b, ok := test.expect.(bool); ok && !b {
|
if b, ok := test.expect.(bool); ok && !b {
|
||||||
c.Assert(err, qt.Not(qt.IsNil), qt.Commentf("%v", test))
|
c.Check(err, qt.Not(qt.IsNil), qt.Commentf("%v", test))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user