File tree 2 files changed +38
-50
lines changed 2 files changed +38
-50
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // Copyright 2023 The Gitea Authors. All rights reserved.
2
+ // SPDX-License-Identifier: MIT
3
+
4
+ package main
5
+
6
+ import (
7
+ "bytes"
8
+ "context"
9
+ "io"
10
+ "testing"
11
+
12
+ "code.gitea.io/gitea/modules/markup"
13
+ "code.gitea.io/gitea/modules/markup/markdown"
14
+ "code.gitea.io/gitea/modules/setting"
15
+ )
16
+
17
+ var renderContext = markup.RenderContext {
18
+ Ctx : context .Background (),
19
+ URLPrefix : "https://example.com/go-gitea/gitea" ,
20
+ Metas : map [string ]string {
21
+ "user" : "go-gitea" ,
22
+ "repo" : "gitea" ,
23
+ },
24
+ }
25
+
26
+ func FuzzMarkdownRenderRaw (f * testing.F ) {
27
+ f .Fuzz (func (t * testing.T , data []byte ) {
28
+ setting .AppURL = "http://localhost:3000/"
29
+ markdown .RenderRaw (& renderContext , bytes .NewReader (data ), io .Discard )
30
+ })
31
+ }
32
+
33
+ func FuzzMarkupPostProcess (f * testing.F ) {
34
+ f .Fuzz (func (t * testing.T , data []byte ) {
35
+ setting .AppURL = "http://localhost:3000/"
36
+ markup .PostProcess (& renderContext , bytes .NewReader (data ), io .Discard )
37
+ })
38
+ }
You can’t perform that action at this time.
0 commit comments