mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-03 09:49:07 +01:00
Added failing test case for command with single non-String arg
This commit is contained in:
parent
24f09761e8
commit
e4449e49f3
1 changed files with 16 additions and 0 deletions
|
@ -18,6 +18,22 @@ fn parse_command_with_args() {
|
||||||
assert_eq!(actual, expected)
|
assert_eq!(actual, expected)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn parse_command_with_non_string_arg() {
|
||||||
|
#[command(rename = "lowercase")]
|
||||||
|
#[derive(BotCommand, Debug, PartialEq)]
|
||||||
|
enum DefaultCommands {
|
||||||
|
Start(i32),
|
||||||
|
Help,
|
||||||
|
}
|
||||||
|
|
||||||
|
let data = "/start -50";
|
||||||
|
let expected = DefaultCommands::Start("-50".parse().unwrap());
|
||||||
|
let actual = DefaultCommands::parse(data, "").unwrap();
|
||||||
|
assert_eq!(actual, expected)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn attribute_prefix() {
|
fn attribute_prefix() {
|
||||||
#[command(rename = "lowercase")]
|
#[command(rename = "lowercase")]
|
||||||
|
|
Loading…
Reference in a new issue