From 58cb5ad15211df472dd0b9cd672d016ab4efe574 Mon Sep 17 00:00:00 2001 From: p0lunin Date: Sat, 4 Jul 2020 10:44:42 +0300 Subject: [PATCH] added test for descriptions="off" attribute --- Cargo.toml | 2 +- tests/command.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 0235fc94..4996921d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ futures = "0.3.1" pin-project = "0.4.6" serde_with_macros = "1.0.1" -teloxide-macros = "0.3.0" +teloxide-macros = { git = "http://github.com/teloxide/teloxide-macros", branch = "dev" } [dev-dependencies] smart-default = "0.6.0" diff --git a/tests/command.rs b/tests/command.rs index eadb214d..f3fc1912 100644 --- a/tests/command.rs +++ b/tests/command.rs @@ -171,3 +171,19 @@ fn parse_named_fields() { 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() + ); +}