mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 06:25:10 +01:00
fmt
This commit is contained in:
parent
dad067da44
commit
0f4ee3023a
1 changed files with 7 additions and 10 deletions
|
@ -150,14 +150,12 @@ mod tests {
|
||||||
}
|
}
|
||||||
#[test]
|
#[test]
|
||||||
fn serialize() {
|
fn serialize() {
|
||||||
let keyboard = vec![
|
let keyboard = vec![vec![
|
||||||
vec![
|
KeyboardButton::new("a"),
|
||||||
KeyboardButton::new("a"),
|
KeyboardButton::new("b"),
|
||||||
KeyboardButton::new("b"),
|
KeyboardButton::new("c"),
|
||||||
KeyboardButton::new("c"),
|
KeyboardButton::new("d"),
|
||||||
KeyboardButton::new("d"),
|
]];
|
||||||
]
|
|
||||||
];
|
|
||||||
let keyboard_markup = KeyboardMarkup::new(keyboard)
|
let keyboard_markup = KeyboardMarkup::new(keyboard)
|
||||||
.persistent()
|
.persistent()
|
||||||
.resize_keyboard()
|
.resize_keyboard()
|
||||||
|
@ -165,7 +163,6 @@ mod tests {
|
||||||
.one_time_keyboard();
|
.one_time_keyboard();
|
||||||
let expected = r#"{"keyboard":[[{"text":"a"},{"text":"b"},{"text":"c"},{"text":"d"}]],"is_persistent":true,"resize_keyboard":true,"one_time_keyboard":true,"selective":true}"#;
|
let expected = r#"{"keyboard":[[{"text":"a"},{"text":"b"},{"text":"c"},{"text":"d"}]],"is_persistent":true,"resize_keyboard":true,"one_time_keyboard":true,"selective":true}"#;
|
||||||
|
|
||||||
assert!(serde_json::ser::to_string(&keyboard_markup).is_ok_and(|s|s.eq(expected)));
|
assert!(serde_json::ser::to_string(&keyboard_markup).is_ok_and(|s| s.eq(expected)));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue