This commit is contained in:
Maybe Waffle 2023-01-14 18:39:13 +04:00
parent f5afbf2188
commit 01bc5a990b
4 changed files with 13 additions and 0 deletions

View file

@ -594,6 +594,8 @@ mod tests {
photo: None, photo: None,
pinned_message: None, pinned_message: None,
message_auto_delete_time: None, message_auto_delete_time: None,
has_hidden_members: false,
has_aggressive_anti_spam_enabled: false,
}; };
let actual = from_str(r#"{"id":-1,"type":"channel","username":"channel_name"}"#).unwrap(); let actual = from_str(r#"{"id":-1,"type":"channel","username":"channel_name"}"#).unwrap();
assert_eq!(expected, actual); assert_eq!(expected, actual);
@ -616,6 +618,8 @@ mod tests {
photo: None, photo: None,
pinned_message: None, pinned_message: None,
message_auto_delete_time: None, message_auto_delete_time: None,
has_hidden_members: false,
has_aggressive_anti_spam_enabled: false,
}, },
from_str(r#"{"id":0,"type":"private","username":"username","first_name":"Anon"}"#) from_str(r#"{"id":0,"type":"private","username":"username","first_name":"Anon"}"#)
.unwrap() .unwrap()
@ -638,6 +642,8 @@ mod tests {
photo: None, photo: None,
pinned_message: None, pinned_message: None,
message_auto_delete_time: None, message_auto_delete_time: None,
has_hidden_members: false,
has_aggressive_anti_spam_enabled: false,
}; };
let json = to_string(&chat).unwrap(); let json = to_string(&chat).unwrap();

View file

@ -573,6 +573,7 @@ mod tests {
caption: None, caption: None,
parse_mode: None, parse_mode: None,
caption_entities: None, caption_entities: None,
has_spoiler: false,
}); });
let actual_json = serde_json::to_string(&photo).unwrap(); let actual_json = serde_json::to_string(&photo).unwrap();
@ -592,6 +593,7 @@ mod tests {
duration: None, duration: None,
supports_streaming: None, supports_streaming: None,
caption_entities: None, caption_entities: None,
has_spoiler: false,
}); });
let actual_json = serde_json::to_string(&video).unwrap(); let actual_json = serde_json::to_string(&video).unwrap();
@ -610,6 +612,7 @@ mod tests {
height: None, height: None,
duration: None, duration: None,
caption_entities: None, caption_entities: None,
has_spoiler: false,
}); });
let actual_json = serde_json::to_string(&video).unwrap(); let actual_json = serde_json::to_string(&video).unwrap();

View file

@ -1630,6 +1630,8 @@ mod tests {
message_auto_delete_time: None, message_auto_delete_time: None,
photo: None, photo: None,
pinned_message: None, pinned_message: None,
has_hidden_members: false,
has_aggressive_anti_spam_enabled: false,
}; };
assert!(message.from().unwrap().is_anonymous()); assert!(message.from().unwrap().is_anonymous());

View file

@ -348,6 +348,8 @@ mod test {
photo: None, photo: None,
pinned_message: None, pinned_message: None,
message_auto_delete_time: None, message_auto_delete_time: None,
has_hidden_members: false,
has_aggressive_anti_spam_enabled: false,
}, },
kind: MessageKind::Common(MessageCommon { kind: MessageKind::Common(MessageCommon {
from: Some(User { from: Some(User {