mirror of
https://github.com/go-gitea/gitea
synced 2024-10-31 23:34:25 +00:00
086a46994a
* Rewrite markdown rendering to blackfriday v2.0 * Fix style * Fix go mod with golang 1.13 * Fix blackfriday v2 import * Inital orgmode renderer migration to go-org * Vendor go-org dependency * Ignore errors :/ * Update go-org to latest version * Update test * Fix go-org test * Remove unneeded code * Fix comments * Fix markdown test * Fix blackfriday regression rendering HTML block
28 lines
590 B
Go
Vendored
28 lines
590 B
Go
Vendored
// +build gofuzz
|
|
|
|
package org
|
|
|
|
import (
|
|
"bytes"
|
|
"strings"
|
|
)
|
|
|
|
// Fuzz function to be used by https://github.com/dvyukov/go-fuzz
|
|
func Fuzz(input []byte) int {
|
|
conf := New().Silent()
|
|
d := conf.Parse(bytes.NewReader(input), "")
|
|
orgOutput, err := d.Write(NewOrgWriter())
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
htmlOutputA, err := d.Write(NewHTMLWriter())
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
htmlOutputB, err := conf.Parse(strings.NewReader(orgOutput), "").Write(NewHTMLWriter())
|
|
if htmlOutputA != htmlOutputB {
|
|
panic("rendered org results in different html than original input")
|
|
}
|
|
return 0
|
|
}
|