Fix missed if_op refactor. Ensure with tests.

This commit is contained in:
Abiola Ibrahim
2016-06-21 20:41:09 +01:00
parent e585a74115
commit cad9b3f62f
2 changed files with 23 additions and 2 deletions
+21
View File
@@ -263,3 +263,24 @@ func TestSetupIfMatcher(t *testing.T) {
}
}
}
func TestIfMatcherKeyword(t *testing.T) {
tests := []struct {
keyword string
expected bool
}{
{"if", true},
{"ifs", false},
{"tls", false},
{"http", false},
{"if_op", true},
{"if_type", false},
{"if_cond", false},
}
for i, test := range tests {
valid := IfMatcherKeyword(test.keyword)
if valid != test.expected {
t.Errorf("Test %d: expected %v found %v", i, test.expected, valid)
}
}
}