mirror of
https://github.com/go-gitea/gitea.git
synced 2024-08-22 20:33:46 +02:00
* 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
28 lines
590 B
Go
// +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
|
|
}
|