github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/lang/functions_fuzz_test.go (about) 1 //go:build go1.18 2 // +build go1.18 3 4 package lang_test 5 6 import ( 7 "testing" 8 9 "github.com/lmorg/murex/lang" 10 "github.com/lmorg/murex/test/count" 11 ) 12 13 func FuzzFuncParseDataTypes(f *testing.F) { 14 tests := []string{"name: str, age: int", "", "!12345", `age: int "how old are you?" [123]`} 15 for _, tc := range tests { 16 f.Add(tc) // Use f.Add to provide a seed corpus 17 } 18 f.Fuzz(func(t *testing.T, orig string) { 19 count.Tests(t, 1) 20 lang.ParseMxFunctionParameters(orig) 21 // we are just testing we can't cause an unhandled panic 22 }) 23 }