mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
prettified json
This commit is contained in:
parent
83332c7421
commit
7ffb067434
1 changed files with 33 additions and 1 deletions
|
@ -55,7 +55,39 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn deserialize() {
|
||||
let data = r#"{"allows_multiple_answers":false,"id":"5377643193141559299","is_anonymous":true,"is_closed":false,"options":[{"text":"1","voter_count":1},{"text":"2","voter_count":0},{"text":"3","voter_count":0},{"text":"4","voter_count":0},{"text":"5","voter_count":0}],"question":"Rate me from 1 to 5.","total_voter_count":1,"type":"regular"}"#;
|
||||
let data = r#"
|
||||
{
|
||||
"allows_multiple_answers": false,
|
||||
"id": "5377643193141559299",
|
||||
"is_anonymous": true,
|
||||
"is_closed": false,
|
||||
"options": [
|
||||
{
|
||||
"text": "1",
|
||||
"voter_count": 1
|
||||
},
|
||||
{
|
||||
"text": "2",
|
||||
"voter_count": 0
|
||||
},
|
||||
{
|
||||
"text": "3",
|
||||
"voter_count": 0
|
||||
},
|
||||
{
|
||||
"text": "4",
|
||||
"voter_count": 0
|
||||
},
|
||||
{
|
||||
"text": "5",
|
||||
"voter_count": 0
|
||||
}
|
||||
],
|
||||
"question": "Rate me from 1 to 5.",
|
||||
"total_voter_count": 1,
|
||||
"type": "regular"
|
||||
}
|
||||
"#;
|
||||
serde_json::from_str::<Poll>(data).unwrap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue