message: added unit tests for the filter
diff: @@ -285,6 +285,7 @@ impl PartialEq for RegexFilter {
  #[cfg(test)]
  mod tests {
  use super::*;
  + use reqwest::Url;
  #[test]
  /// just a simple test to increase code coverage by hitting as_any and the inner value
  @@ -350,4 +351,66 @@ mod tests {
  filter
  );
  }
  +
  + #[test]
  + /// test should_filter on WilcardFilter where static logic matches
  + fn wildcard_should_filter_when_static_wildcard_found() {
  + let resp = FeroxResponse {
  + text: String::new(),
  + wildcard: true,
  + url: Url::parse("http://localhost").unwrap(),
  + content_length: 100,
  + headers: reqwest::header::HeaderMap::new(),
  + status: reqwest::StatusCode::OK,
  + };
  +
  + let filter = WildcardFilter {
  + size: 100,
  + dynamic: 0,
  + };
  +
  + assert!(filter.should_filter_response(&resp));
  + }
  +
  + #[test]
  + /// test should_filter on WilcardFilter where dynamic logic matches
  + fn wildcard_should_filter_when_dynamic_wildcard_found() {
  + let resp = FeroxResponse {
  + text: String::new(),
  + wildcard: true,
  + url: Url::parse("http://localhost/stuff").unwrap(),
  + content_length: 100,
  + headers: reqwest::header::HeaderMap::new(),
  + status: reqwest::StatusCode::OK,
  + };
  +
  + let filter = WildcardFilter {
  + size: 0,
  + dynamic: 95,
  + };
  +
  + assert!(filter.should_filter_response(&resp));
  + }
  +
  + #[test]
  + /// test should_filter on RegexFilter where regex matches body
  + fn regexfilter_should_filter_when_regex_matches_on_response_body() {
  + let resp = FeroxResponse {
  + text: String::from("im a body response hurr durr!"),
  + wildcard: false,
  + url: Url::parse("http://localhost/stuff").unwrap(),
  + content_length: 100,
  + headers: reqwest::header::HeaderMap::new(),
  + status: reqwest::StatusCode::OK,
  + };
  +
  + let raw = r"response...rr";
  +
  + let filter = RegexFilter {
  + raw_string: raw.to_string(),
  + compiled: Regex::new(raw).unwrap(),
  + };
  +
  + assert!(filter.should_filter_response(&resp));
  + }
  }
  