client-api: Add a test for filter types' Default implementations
This commit is contained in:
parent
5576c2f0ed
commit
aa43d47343
@ -232,3 +232,20 @@ impl<'a> FilterDefinition<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use serde_json::{json, to_value as to_json_value};
|
||||||
|
|
||||||
|
use super::{Filter, FilterDefinition, RoomEventFilter, RoomFilter};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn default_filters_are_empty() -> Result<(), serde_json::Error> {
|
||||||
|
assert_eq!(to_json_value(Filter::default())?, json!({}));
|
||||||
|
assert_eq!(to_json_value(FilterDefinition::default())?, json!({}));
|
||||||
|
assert_eq!(to_json_value(RoomEventFilter::default())?, json!({}));
|
||||||
|
assert_eq!(to_json_value(RoomFilter::default())?, json!({}));
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user