magnusbaeck / logstash-filter-verifier

Apache License 2.0
192 stars 27 forks source link

test case on negative scenario #80

Closed kercdbh closed 4 years ago

kercdbh commented 4 years ago

Hi,

is there a way to write a test case for a negative scenario? Testing for example a filter logic that use drop to discard unwanted logs...

I was very naively thinking that setting expected to null could be the way for a test case to be successful when: "0 message(s) did not match the expectations".

Thanks & regards.

magnusbaeck commented 4 years ago

I wouldn't expect setting expected to null to work, but setting it to an empty list should be fine. Have you tried that?

kercdbh commented 4 years ago

expected: [] did the trick.

Thanks!