0
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-01-31 18:05:00 -05:00

Fix fuzz test (#33156)

(cherry picked from commit ba5e3a5161a497aa8c73827774870fb94676e68b)
This commit is contained in:
Lunny Xiao 2025-01-08 23:15:47 -08:00 committed by Earl Warren
parent f809052193
commit d09b8ba9cf
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -27,6 +27,7 @@ var renderContext = markup.RenderContext{
func FuzzMarkdownRenderRaw(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
setting.IsInTesting = true
setting.AppURL = "http://localhost:3000/"
markdown.RenderRaw(&renderContext, bytes.NewReader(data), io.Discard)
})
@ -34,6 +35,7 @@ func FuzzMarkdownRenderRaw(f *testing.F) {
func FuzzMarkupPostProcess(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
setting.IsInTesting = true
setting.AppURL = "http://localhost:3000/"
markup.PostProcess(&renderContext, bytes.NewReader(data), io.Discard)
})