fuzz_test.go 301 B

123456789101112131415161718
  1. //go:build go1.18
  2. package eval
  3. import (
  4. "testing"
  5. "src.elv.sh/pkg/parse"
  6. )
  7. func FuzzCheck(f *testing.F) {
  8. f.Add("echo")
  9. f.Add("put $x")
  10. f.Add("put foo bar | each {|x| echo $x }")
  11. f.Fuzz(func(t *testing.T, code string) {
  12. NewEvaler().Check(parse.Source{Name: "fuzz", Code: code}, nil)
  13. })
  14. }