Skip to content

Commit

Permalink
test: add fuzz test for analyze
Browse files Browse the repository at this point in the history
Signed-off-by: Zxilly <[email protected]>
  • Loading branch information
Zxilly committed Jun 19, 2024
1 parent 0f50890 commit ea968e3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions internal/analyze_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package internal

import (
"bytes"
"github.com/stretchr/testify/require"
"testing"
)

func FuzzAnalyze(f *testing.F) {
f.Fuzz(func(t *testing.T, name string, data []byte) {
require.NotPanics(t, func() {
reader := bytes.NewReader(data)
_, err := Analyze(name, reader, uint64(len(data)), Options{})
if err != nil {
t.Logf("Error: %v", err)
}
})
})
}

0 comments on commit ea968e3

Please sign in to comment.