1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Add a couple of fuzzers

This commit is contained in:
jvoisin 2024-02-26 13:44:42 +01:00 committed by Frédéric Guillot
parent 9d1b1e19d4
commit 4a943b722d
2 changed files with 64 additions and 0 deletions

View file

@ -7,6 +7,14 @@ import (
"testing"
)
func FuzzParse(f *testing.F) {
f.Add("2017-12-22T22:09:49+00:00")
f.Add("Fri, 31 Mar 2023 20:19:00 America/Los_Angeles")
f.Fuzz(func(t *testing.T, date string) {
Parse(date)
})
}
func TestParseEmptyDate(t *testing.T) {
if _, err := Parse(" "); err == nil {
t.Fatalf(`Empty dates should return an error`)