mirror of
https://github.com/teloxide/teloxide.git
synced 2024-10-24 09:57:18 +02:00
Add regression test for issue 473
This commit is contained in:
parent
3ccf624168
commit
c4b148459d
2 changed files with 20 additions and 0 deletions
|
@ -58,6 +58,7 @@ bitflags = { version = "1.2", optional = true }
|
|||
|
||||
[dev-dependencies]
|
||||
pretty_env_logger = "0.4"
|
||||
tokio = { version = "1.8.0", features = ["fs", "macros"] }
|
||||
|
||||
[features]
|
||||
default = ["native-tls"]
|
||||
|
|
|
@ -29,3 +29,22 @@ pub(crate) fn to_form<T: ?Sized + Serialize>(val: &T) -> impl Future<Output = Re
|
|||
let fut = val.serialize(MultipartTopLvlSerializer {});
|
||||
async { Ok(fut?.await?) }
|
||||
}
|
||||
|
||||
// https://github.com/teloxide/teloxide/issues/473
|
||||
#[tokio::test]
|
||||
async fn issue_473() {
|
||||
use crate::{
|
||||
payloads::{self, SendPhotoSetters},
|
||||
types::{InputFile, MessageEntity, MessageEntityKind},
|
||||
};
|
||||
|
||||
to_form(
|
||||
&payloads::SendPhoto::new(0, InputFile::file_id("0")).caption_entities([MessageEntity {
|
||||
kind: MessageEntityKind::Url,
|
||||
offset: 0,
|
||||
length: 0,
|
||||
}]),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue