mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
More tests
This commit is contained in:
parent
835f31be80
commit
e73ed1bd0e
1 changed files with 27 additions and 0 deletions
|
@ -200,6 +200,33 @@ fn parse_with_command_separator2() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "macros")]
|
||||
fn parse_with_command_separator3() {
|
||||
#[derive(BotCommands, Debug, PartialEq)]
|
||||
#[command(rename_rule = "lowercase")]
|
||||
#[command(parse_with = "split", command_separator = ":")]
|
||||
enum DefaultCommands {
|
||||
Help,
|
||||
}
|
||||
|
||||
assert_eq!(DefaultCommands::Help, DefaultCommands::parse("/help", "").unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "macros")]
|
||||
fn parse_with_command_separator4() {
|
||||
#[derive(BotCommands, Debug, PartialEq)]
|
||||
#[command(rename_rule = "lowercase")]
|
||||
#[command(parse_with = "split", command_separator = ":")]
|
||||
enum DefaultCommands {
|
||||
Start(u8),
|
||||
Help,
|
||||
}
|
||||
|
||||
assert_eq!(DefaultCommands::Start(10), DefaultCommands::parse("/start:10", "").unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "macros")]
|
||||
fn parse_custom_parser() {
|
||||
|
|
Loading…
Reference in a new issue