@@ -44,19 +44,19 @@ func TestMatchDefault(t *testing.T) {
4444 m := NewMatcher ()
4545 m .AddRule (NewRuleDevpath ("devpaht-1" ))
4646 m .AddRule (NewRuleDevpath ("devpaht-2" ))
47- if len (m .Match (devices )) != 0 {
47+ if len (m .Matches (devices )) != 0 {
4848 t .Fatal ("Devices was found incorrectly" )
4949 }
5050
5151 m2 := NewMatcher ()
5252 m2 .AddRule (NewRuleDevpath ("devpaht-.+" ))
5353 m2 .AddRule (NewRuleDevpath ("devpaht-[0-9]+" ))
54- if len (m2 .Match (devices )) != 2 {
54+ if len (m2 .Matches (devices )) != 2 {
5555 t .Fatal ("Not found two devices" )
5656 }
5757
5858 m3 := NewMatcher ()
59- if len (m3 .Match (devices )) != 0 {
59+ if len (m3 .Matches (devices )) != 0 {
6060 t .Fatal ("Empty rules Matcher finded not 0 devices" )
6161 }
6262}
@@ -68,34 +68,34 @@ func TestMatchAnd(t *testing.T) {
6868 m .SetStrategy (StrategyAnd )
6969 m .AddRule (NewRuleDevpath ("devpaht-1" ))
7070 m .AddRule (NewRuleDevpath ("devpaht-2" ))
71- if len (m .Match (devices )) != 0 {
71+ if len (m .Matches (devices )) != 0 {
7272 t .Fatal ("Devices was found incorrectly" )
7373 }
7474
7575 m2 := NewMatcher ()
7676 m2 .SetStrategy (StrategyAnd )
7777 m2 .AddRule (NewRuleDevpath ("devpaht-.+" ))
7878 m2 .AddRule (NewRuleDevpath ("devpaht-[0-9]+" ))
79- if len (m2 .Match (devices )) != 2 {
79+ if len (m2 .Matches (devices )) != 2 {
8080 t .Fatal ("Not found two devices" )
8181 }
8282
8383 m2 .AddRule (NewRuleEnv ("ENV-1" , "[a-z]+" ))
8484 m2 .AddRule (NewRuleEnv ("ENV-2" , "[0-9]+" ))
8585 m2 .AddRule (NewRuleAttr ("ATTR-1" , "[a-z]+" ))
8686 m2 .AddRule (NewRuleAttr ("ATTR-2" , "[0-9]+" ))
87- if len (m2 .Match (devices )) != 2 {
87+ if len (m2 .Matches (devices )) != 2 {
8888 t .Fatal ("Not found two devices" )
8989 }
9090
9191 m2 .AddRule (NewRuleAttr ("ATTR-2" , "123" ))
92- if len (m .Match (devices )) != 0 {
92+ if len (m .Matches (devices )) != 0 {
9393 t .Fatal ("Devices was found incorrectly" )
9494 }
9595
9696 m3 := NewMatcher ()
9797 m3 .SetStrategy (StrategyAnd )
98- if len (m3 .Match (devices )) != 0 {
98+ if len (m3 .Matches (devices )) != 0 {
9999 t .Fatal ("Empty rules Matcher finded not 0 devices" )
100100 }
101101}
@@ -107,12 +107,12 @@ func TestMatchOr(t *testing.T) {
107107 m .SetStrategy (StrategyOr )
108108 m .AddRule (NewRuleDevpath ("devpaht-1" ))
109109 m .AddRule (NewRuleDevpath ("devpaht-3" ))
110- if len (m .Match (devices )) != 1 {
110+ if len (m .Matches (devices )) != 1 {
111111 t .Fatal ("Not found one device" )
112112 }
113113
114114 m .AddRule (NewRuleDevpath ("devpaht-2" ))
115- if len (m .Match (devices )) != 2 {
115+ if len (m .Matches (devices )) != 2 {
116116 t .Fatal ("Not found two devices" )
117117 }
118118
@@ -123,13 +123,13 @@ func TestMatchOr(t *testing.T) {
123123 m2 .AddRule (NewRuleEnv ("ENV-2" , "NOT_FOUND" ))
124124 m2 .AddRule (NewRuleAttr ("ATTR-1" , "ghi456jkl" ))
125125 m2 .AddRule (NewRuleAttr ("ATTR-2" , "NOT_FOUND" ))
126- if len (m2 .Match (devices )) != 2 {
126+ if len (m2 .Matches (devices )) != 2 {
127127 t .Fatal ("Not found two devices" )
128128 }
129129
130130 m3 := NewMatcher ()
131131 m3 .SetStrategy (StrategyOr )
132- if len (m3 .Match (devices )) != 0 {
132+ if len (m3 .Matches (devices )) != 0 {
133133 t .Fatal ("Empty rules Matcher finded not 0 devices" )
134134 }
135135}
0 commit comments