Fix fuzz test (#33156)

(cherry picked from commit ba5e3a5161a497aa8c73827774870fb94676e68b)
This commit is contained in:
Lunny Xiao
2025-01-12 09:02:47 +01:00
committed by Earl Warren
parent f809052193
commit d09b8ba9cf
+2
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)
})