mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-03 09:49:07 +01:00
More than one attribute for the description test
This commit is contained in:
parent
0d02c48afd
commit
7304e552cd
1 changed files with 24 additions and 0 deletions
|
@ -264,6 +264,30 @@ fn description_with_doc_attr() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(feature = "macros")]
|
||||||
|
fn description_with_doc_attr_and_command() {
|
||||||
|
#[derive(BotCommands, Debug, PartialEq)]
|
||||||
|
#[command(rename_rule = "lowercase")]
|
||||||
|
enum DefaultCommands {
|
||||||
|
/// Start command
|
||||||
|
#[command(description = "Start command")]
|
||||||
|
Start,
|
||||||
|
#[command(description = "Help command\nwith new line")]
|
||||||
|
Help,
|
||||||
|
/// Foo command
|
||||||
|
/// with new line
|
||||||
|
#[command(description = "Foo command\nwith new line")]
|
||||||
|
Foo,
|
||||||
|
}
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
DefaultCommands::descriptions().to_string(),
|
||||||
|
"/start — Start command\nStart command\n/help — Help command\nwith new line\n/foo — Foo command\nwith \
|
||||||
|
new line\nFoo command\nwith new line"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "macros")]
|
#[cfg(feature = "macros")]
|
||||||
fn rename_rules() {
|
fn rename_rules() {
|
||||||
|
|
Loading…
Reference in a new issue