return func(t *testing.T) {
req := NewRequest(t, "GET", fmt.Sprintf("/%s/%s/pulls/%d.diff", url.PathEscape(ctx.Username), url.PathEscape(ctx.Reponame), pr.Index))
resp := ctx.Session.MakeRequest(t, req, http.StatusOK)
- assert.Equal(t, diffStr, resp.Body.String())
+ expectedMaxLen := len(diffStr)
+ if expectedMaxLen > 800 {
+ expectedMaxLen = 800
+ }
+ actual := resp.Body.String()
+ actualMaxLen := len(actual)
+ if actualMaxLen > 800 {
+ actualMaxLen = 800
+ }
+ assert.Equal(t, diffStr, actual, "Unexpected change in the diff string: expected: %s but was actually: %s", diffStr[:expectedMaxLen], actual[:actualMaxLen])
}
}
"regexp"
"strings"
- "code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/markup"
"code.gitea.io/gitea/modules/markup/common"
"code.gitea.io/gitea/modules/setting"
// But most importantly ensure the next sibling is still on the old image too
v.SetNextSibling(next)
-
- } else {
- log.Debug("ast.Image: %s has parent: %v", link, parent)
-
}
case *ast.Link:
// Links need their href to munged to be a real value