mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-01 23:29:12 +01:00
9fe4437bda
* Use vendored go-swagger * vendor go-swagger * revert un wanteed change * remove un-needed GO111MODULE * Update Makefile Co-Authored-By: techknowlogick <matti@mdranta.net>
31 lines
472 B
Go
Vendored
31 lines
472 B
Go
Vendored
// +build gofuzz
|
|
|
|
package toml
|
|
|
|
func Fuzz(data []byte) int {
|
|
tree, err := LoadBytes(data)
|
|
if err != nil {
|
|
if tree != nil {
|
|
panic("tree must be nil if there is an error")
|
|
}
|
|
return 0
|
|
}
|
|
|
|
str, err := tree.ToTomlString()
|
|
if err != nil {
|
|
if str != "" {
|
|
panic(`str must be "" if there is an error`)
|
|
}
|
|
panic(err)
|
|
}
|
|
|
|
tree, err = Load(str)
|
|
if err != nil {
|
|
if tree != nil {
|
|
panic("tree must be nil if there is an error")
|
|
}
|
|
return 0
|
|
}
|
|
|
|
return 1
|
|
}
|