Added failing test case for command with single non-String arg

This commit is contained in:
Robin Hundt 2020-08-28 23:33:16 +02:00
parent 24f09761e8
commit e4449e49f3

View file

@ -18,6 +18,22 @@ fn parse_command_with_args() {
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]
fn attribute_prefix() {
#[command(rename = "lowercase")]