add a test deserializing empty serialized watched field
@@ -117,6 +117,7 @@ impl fmt::Display for WatchedBitField {
#[cfg(test)]
mod tests {
+ use crate::bitfield8::BitField8;
use crate::WatchedBitField;
#[test]
@@ -125,4 +126,16 @@ mod tests {
let serialized = watched.to_string();
assert_eq!(serialized, "undefined:1:eJwDAAAAAAE=");
}
+
+ #[test]
+ fn deserialize_empty() {
+ let watched = WatchedBitField::construct_and_resize("undefined:1:eJwDAAAAAAE=", vec![]);
+ assert_eq!(
+ watched,
+ Ok(WatchedBitField {
+ bitfield: BitField8::new(0),
+ video_ids: vec![]
+ })
+ );
+ }
}
