github.com/aavshr/aws-sdk-go@v1.41.3/internal/ini/fuzz_test.go (about)

     1  //go:build fuzz
     2  // +build fuzz
     3  
     4  // fuzz test data is stored in Amazon S3.
     5  package ini_test
     6  
     7  import (
     8  	"path/filepath"
     9  	"testing"
    10  
    11  	"github.com/aavshr/aws-sdk-go/internal/ini"
    12  )
    13  
    14  // TestFuzz is used to test for crashes and not validity of the input
    15  func TestFuzz(t *testing.T) {
    16  	paths, err := filepath.Glob("testdata/fuzz/*")
    17  	if err != nil {
    18  		t.Errorf("expected no error, but received %v", err)
    19  	}
    20  
    21  	if paths == nil {
    22  		t.Errorf("expected fuzz files, but received none")
    23  	}
    24  
    25  	for _, path := range paths {
    26  		t.Run(path, func(t *testing.T) {
    27  			ini.OpenFile(path)
    28  		})
    29  	}
    30  }