Merge pull request #272 from robinhundt/dev

Added failing test case for command with single non-String arg
This commit is contained in:
Temirkhan Myrzamadi 2020-09-05 19:30:04 +06:00 committed by GitHub
commit bbdff7d988
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,21 @@ 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")]