mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Add tests for /// Help message
This commit is contained in:
parent
e3b5572879
commit
b91c53588d
1 changed files with 18 additions and 0 deletions
|
@ -242,6 +242,24 @@ fn descriptions_off() {
|
||||||
assert_eq!(DefaultCommands::descriptions().to_string(), "/help".to_owned());
|
assert_eq!(DefaultCommands::descriptions().to_string(), "/help".to_owned());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(feature = "macros")]
|
||||||
|
fn description_with_doc_attr() {
|
||||||
|
#[derive(BotCommands, Debug, PartialEq)]
|
||||||
|
#[command(rename_rule = "lowercase")]
|
||||||
|
enum DefaultCommands {
|
||||||
|
/// Start command
|
||||||
|
Start,
|
||||||
|
/// Help command\nwith new line
|
||||||
|
Help,
|
||||||
|
}
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
DefaultCommands::descriptions().to_string(),
|
||||||
|
"/start — Start command\n/help — Help command\nwith new line"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "macros")]
|
#[cfg(feature = "macros")]
|
||||||
fn rename_rules() {
|
fn rename_rules() {
|
||||||
|
|
Loading…
Reference in a new issue