"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tpl/strings/strings_test.go" between
hugo-0.80.0.tar.gz and hugo-0.81.0.tar.gz

About: Hugo is a static site generator that takes a source directory of Markdown files and templates and uses these as input to create a complete website (written in Go).

strings_test.go  (hugo-0.80.0):strings_test.go  (hugo-0.81.0)
skipping to change at line 454 skipping to change at line 454
{"abcdef", 0, 0, ""}, {"abcdef", 0, 0, ""},
{"abcdef", 1, 0, ""}, {"abcdef", 1, 0, ""},
{"abcdef", -1, 0, ""}, {"abcdef", -1, 0, ""},
{"abcdef", -1, 2, "f"}, {"abcdef", -1, 2, "f"},
{"abcdef", -3, 3, "def"}, {"abcdef", -3, 3, "def"},
{"abcdef", -1, nil, "f"}, {"abcdef", -1, nil, "f"},
{"abcdef", -2, nil, "ef"}, {"abcdef", -2, nil, "ef"},
{"abcdef", -3, 1, "d"}, {"abcdef", -3, 1, "d"},
{"abcdef", 0, -1, "abcde"}, {"abcdef", 0, -1, "abcde"},
{"abcdef", 2, -1, "cde"}, {"abcdef", 2, -1, "cde"},
{"abcdef", 4, -4, false}, {"abcdef", 4, -4, ""},
{"abcdef", 7, 1, false}, {"abcdef", 7, 1, ""},
{"abcdef", 6, nil, ""},
{"abcdef", 1, 100, "bcdef"}, {"abcdef", 1, 100, "bcdef"},
{"abcdef", -100, 3, "abc"}, {"abcdef", -100, 3, "abc"},
{"abcdef", -3, -1, "de"}, {"abcdef", -3, -1, "de"},
{"abcdef", 2, nil, "cdef"}, {"abcdef", 2, nil, "cdef"},
{"abcdef", int8(2), nil, "cdef"}, {"abcdef", int8(2), nil, "cdef"},
{"abcdef", int16(2), nil, "cdef"}, {"abcdef", int16(2), nil, "cdef"},
{"abcdef", int32(2), nil, "cdef"}, {"abcdef", int32(2), nil, "cdef"},
{"abcdef", int64(2), nil, "cdef"}, {"abcdef", int64(2), nil, "cdef"},
{"abcdef", 2, int8(3), "cde"}, {"abcdef", 2, int8(3), "cde"},
{"abcdef", 2, int16(3), "cde"}, {"abcdef", 2, int16(3), "cde"},
skipping to change at line 478 skipping to change at line 479
{123, 1, 3, "23"}, {123, 1, 3, "23"},
{1.2e3, 0, 4, "1200"}, {1.2e3, 0, 4, "1200"},
{tstNoStringer{}, 0, 1, false}, {tstNoStringer{}, 0, 1, false},
{"abcdef", 2.0, nil, "cdef"}, {"abcdef", 2.0, nil, "cdef"},
{"abcdef", 2.0, 2, "cd"}, {"abcdef", 2.0, 2, "cd"},
{"abcdef", 2, 2.0, "cd"}, {"abcdef", 2, 2.0, "cd"},
{"ĀĀĀ", 1, 2, "ĀĀ"}, // # issue 1333 {"ĀĀĀ", 1, 2, "ĀĀ"}, // # issue 1333
{"abcdef", "doo", nil, false}, {"abcdef", "doo", nil, false},
{"abcdef", "doo", "doo", false}, {"abcdef", "doo", "doo", false},
{"abcdef", 1, "doo", false}, {"abcdef", 1, "doo", false},
{"", 0, nil, ""},
} { } {
var result string var result string
if test.v3 == nil { if test.v3 == nil {
result, err = ns.Substr(test.v1, test.v2) result, err = ns.Substr(test.v1, test.v2)
} else { } else {
result, err = ns.Substr(test.v1, test.v2, test.v3) result, err = ns.Substr(test.v1, test.v2, test.v3)
} }
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
} }
c.Assert(err, qt.IsNil) c.Assert(err, qt.IsNil, qt.Commentf("%v", test))
c.Check(result, qt.Equals, test.expect, qt.Commentf("%v", test)) c.Check(result, qt.Equals, test.expect, qt.Commentf("%v", test))
} }
_, err = ns.Substr("abcdef") _, err = ns.Substr("abcdef")
c.Assert(err, qt.Not(qt.IsNil)) c.Assert(err, qt.Not(qt.IsNil))
_, err = ns.Substr("abcdef", 1, 2, 3) _, err = ns.Substr("abcdef", 1, 2, 3)
c.Assert(err, qt.Not(qt.IsNil)) c.Assert(err, qt.Not(qt.IsNil))
} }
 End of changes. 4 change blocks. 
4 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)