src.elv.sh@v0.21.0-dev.0.20240515223629-06979efb9a2a/pkg/eval/fuzz_test.go (about)

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