Skip to content

Commit

Permalink
test(filter): fix test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Oct 20, 2024
1 parent 1ca69ff commit dfc6156
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/filter/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,30 @@ func TestFilter_UnmarshalFilter(t *testing.T) {
future.Format(time.RFC3339), // +24 hours
},
},
{
name: "dateOlderThanNow-invalid-input",
yaml: `{"type":"dateOlderThanNow","value":"-360d4h"}`,
match: []string{strconv.Itoa(int(future.Unix())),
future.Format("2006-01-02"),
},
error: true,
},
{
name: "dateOlderThanNow-invalid-filtered",
yaml: `{"type":"dateOlderThanNow","value":"0"}`,
match: []string{
"31-12-2023",
},
error: true,
},
{
name: "dateOlderThanNow-invalid-filtered2",
yaml: `{"type":"dateOlderThanNow","value":"-34h"}`,
mismatch: []string{
"",
},
error: true,
},
{
yaml: `{"type":"prefix","value":"someprefix-"}`,
match: []string{"someprefix-1234", "someprefix-someprefix", "someprefix-asdafd"},
Expand Down

0 comments on commit dfc6156

Please sign in to comment.