1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

Update filter_test.go's function documentation

This commit is contained in:
JanHoefelmeyer 2023-09-25 11:19:32 +02:00
parent 22e6d49f3f
commit 17945d67ac

View file

@ -13,8 +13,8 @@ import (
"testing" "testing"
) )
// NewPatternMatcher compiles a new list of regular expression from // TestNewPatternMatcher tests if NewPatternMatcher recognizes
// a given list of strings. // whether a set of sample regular expressions is valid
func TestNewPatternMatcher(t *testing.T) { func TestNewPatternMatcher(t *testing.T) {
var regex []string var regex []string
if pm, err := NewPatternMatcher(regex); pm == nil || err != nil { if pm, err := NewPatternMatcher(regex); pm == nil || err != nil {
@ -26,7 +26,8 @@ func TestNewPatternMatcher(t *testing.T) {
} }
} }
// Matches returns true if the given string matches any of the expressions. // TestMatches tests if Matches returns whether a given string
// matches a sample of the expressions correctly.
func TestMatches(t *testing.T) { func TestMatches(t *testing.T) {
regex := []string{"a"} regex := []string{"a"}
pm, _ := NewPatternMatcher(regex) pm, _ := NewPatternMatcher(regex)