To gitea and beyond, let's go(-yco)

This commit is contained in:
2025-11-10 19:12:09 +01:00
parent 8f6133392d
commit 71a031342b
245 changed files with 83994 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
package validation
import (
"strings"
"testing"
"goyco/internal/fuzz"
)
func FuzzValidateEmail(f *testing.F) {
helper := fuzz.NewFuzzTestHelper()
helper.RunValidationFuzzTest(f, ValidateEmail)
}
func FuzzValidateUsername(f *testing.F) {
helper := fuzz.NewFuzzTestHelper()
helper.RunValidationFuzzTest(f, ValidateUsername)
}
func FuzzValidatePassword(f *testing.F) {
helper := fuzz.NewFuzzTestHelper()
helper.RunValidationFuzzTest(f, ValidatePassword)
}
func FuzzValidateURL(f *testing.F) {
helper := fuzz.NewFuzzTestHelper()
helper.RunValidationFuzzTest(f, ValidateURL)
}
func FuzzValidateTitle(f *testing.F) {
helper := fuzz.NewFuzzTestHelper()
helper.RunValidationFuzzTest(f, ValidateTitle)
}
func FuzzValidateContent(f *testing.F) {
helper := fuzz.NewFuzzTestHelper()
helper.RunValidationFuzzTest(f, ValidateContent)
}
func FuzzValidateSearchQuery(f *testing.F) {
helper := fuzz.NewFuzzTestHelper()
helper.RunValidationFuzzTest(f, ValidateSearchQuery)
}
func FuzzSanitizeString(f *testing.F) {
helper := fuzz.NewFuzzTestHelper()
helper.RunSanitizationFuzzTestWithValidation(f,
SanitizeString,
func(result string) bool {
return !containsNullBytes(result)
})
}
func containsNullBytes(s string) bool {
return strings.Contains(s, "\x00")
}