You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
446 B

  1. package fuzz_test
  2. import (
  3. "fmt"
  4. "github.com/tendermint/tendermint/libs/pubsub/query"
  5. )
  6. func Fuzz(data []byte) int {
  7. sdata := string(data)
  8. q0, err := query.New(sdata)
  9. if err != nil {
  10. return 0
  11. }
  12. sdata1 := q0.String()
  13. q1, err := query.New(sdata1)
  14. if err != nil {
  15. panic(err)
  16. }
  17. sdata2 := q1.String()
  18. if sdata1 != sdata2 {
  19. fmt.Printf("q0: %q\n", sdata1)
  20. fmt.Printf("q1: %q\n", sdata2)
  21. panic("query changed")
  22. }
  23. return 1
  24. }