@@ -53,8 +53,10 @@ func TestRule(t *testing.T) {
53
53
assert .Nilf (t , err , "unexpected error: %v" , err )
54
54
assert .Equal (t , r1 .Labels , m .Labels , "empty matcher should have matched empty features" )
55
55
56
- _ , err = Execute (r2 , f )
57
- assert .Error (t , err , "matching against a missing feature should have returned an error" )
56
+ m , err = Execute (r2 , f )
57
+ assert .NoError (t , err , "matching against a missing feature should not have returned an error" )
58
+ assert .Empty (t , m .Labels )
59
+ assert .Empty (t , m .Vars )
58
60
59
61
// Test properly initialized empty features
60
62
f = nfdv1alpha1 .NewFeatures ()
@@ -64,8 +66,10 @@ func TestRule(t *testing.T) {
64
66
assert .Equal (t , r1 .Labels , m .Labels , "empty matcher should have matched empty features" )
65
67
assert .Empty (t , r1 .Vars , "vars should be empty" )
66
68
67
- _ , err = Execute (r2 , f )
68
- assert .Error (t , err , "matching against a missing feature type should have returned an error" )
69
+ m , err = Execute (r2 , f )
70
+ assert .NoError (t , err , "matching against a missing feature should not have returned an error" )
71
+ assert .Empty (t , m .Labels )
72
+ assert .Empty (t , m .Vars )
69
73
70
74
// Test empty feature sets
71
75
f .Flags ["domain-1.kf-1" ] = nfdv1alpha1 .NewFlagFeatures ()
0 commit comments