mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-22 06:45:37 +01:00
added test for descriptions="off" attribute
This commit is contained in:
parent
96a92b6ec2
commit
58cb5ad152
2 changed files with 17 additions and 1 deletions
|
@ -45,7 +45,7 @@ futures = "0.3.1"
|
||||||
pin-project = "0.4.6"
|
pin-project = "0.4.6"
|
||||||
serde_with_macros = "1.0.1"
|
serde_with_macros = "1.0.1"
|
||||||
|
|
||||||
teloxide-macros = "0.3.0"
|
teloxide-macros = { git = "http://github.com/teloxide/teloxide-macros", branch = "dev" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
smart-default = "0.6.0"
|
smart-default = "0.6.0"
|
||||||
|
|
|
@ -171,3 +171,19 @@ fn parse_named_fields() {
|
||||||
DefaultCommands::parse("/start 10 hello", "").unwrap()
|
DefaultCommands::parse("/start 10 hello", "").unwrap()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn descriptions_off() {
|
||||||
|
#[command(rename = "lowercase")]
|
||||||
|
#[derive(BotCommand, Debug, PartialEq)]
|
||||||
|
enum DefaultCommands {
|
||||||
|
#[command(description = "off")]
|
||||||
|
Start,
|
||||||
|
Help,
|
||||||
|
}
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
DefaultCommands::descriptions(),
|
||||||
|
"/help\n".to_owned()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue