本站源代码
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

32 linhas
472B

  1. // +build gofuzz
  2. package toml
  3. func Fuzz(data []byte) int {
  4. tree, err := LoadBytes(data)
  5. if err != nil {
  6. if tree != nil {
  7. panic("tree must be nil if there is an error")
  8. }
  9. return 0
  10. }
  11. str, err := tree.ToTomlString()
  12. if err != nil {
  13. if str != "" {
  14. panic(`str must be "" if there is an error`)
  15. }
  16. panic(err)
  17. }
  18. tree, err = Load(str)
  19. if err != nil {
  20. if tree != nil {
  21. panic("tree must be nil if there is an error")
  22. }
  23. return 0
  24. }
  25. return 1
  26. }
上海开阖软件有限公司 沪ICP备12045867号-1