(t *testing.T)
| 259 | } |
| 260 | |
| 261 | func TestNewOperatorRegexp(t *testing.T) { |
| 262 | t.Log("Test NewOperator() regexp") |
| 263 | var dummyList []Operator |
| 264 | |
| 265 | opRE, err := NewOperator(Regexp, false, OpProto, "^TCP$", dummyList) |
| 266 | if err != nil { |
| 267 | t.Error("NewOperator regexp.err should be nil: ", err) |
| 268 | t.Fail() |
| 269 | } |
| 270 | if err = opRE.Compile(); err != nil { |
| 271 | t.Fail() |
| 272 | } |
| 273 | if opRE.Match(conn, false) == false { |
| 274 | t.Error("Test NewOperator() regexp doesn't match") |
| 275 | t.Fail() |
| 276 | } |
| 277 | |
| 278 | restoreConnection() |
| 279 | } |
| 280 | |
| 281 | func TestNewOperatorInvalidRegexp(t *testing.T) { |
| 282 | t.Log("Test NewOperator() invalid regexp") |
nothing calls this directly
no test coverage detected