File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 jq '.|select(.Action == "output")|select( (.Output|test("^(ok)|(\\?)"))|not )|{package: .Package, test: (.Output|gsub("\n";""))}'|\
4242 jq --slurp \
4343 )
44- echo "matrix=${fuzz_test}" >> "${GITHUB_OUTPUT}"
44+ export fuzz_tests
45+ echo "matrix<<EOF" >> "${GITHUB_OUTPUT}"
46+ printenv fuzz_tests >> "${GITHUB_OUTPUT}"
47+ echo "EOF" >> "${GITHUB_OUTPUT}"
4548 echo "::notice title=Fuzz tests found:${fuzz_tests}"
4649
4750 fuzz-test :
Original file line number Diff line number Diff line change @@ -4,3 +4,11 @@ package sample
44func Sample () int {
55 return 1
66}
7+
8+ func fuzzable (input []byte ) string {
9+ if len (input ) > 0 {
10+ return string (input )
11+ }
12+
13+ return "0"
14+ }
Original file line number Diff line number Diff line change @@ -17,3 +17,15 @@ func TestSample(t *testing.T) {
1717 */
1818 require .Equal (t , 1 , Sample ())
1919}
20+
21+ func FuzzSample (f * testing.F ) {
22+ f .Add ([]byte (nil ))
23+ f .Add ([]byte {})
24+ f .Add ([]byte {'x' })
25+
26+ f .Fuzz (func (t * testing.T , input []byte ) {
27+ require .NotPanics (t , func () {
28+ _ = fuzzable (input )
29+ })
30+ })
31+ }
You can’t perform that action at this time.
0 commit comments