diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c21257f..a27331e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed + +- Updated `teloxide-macros` see its [changelog](https://github.com/teloxide/teloxide-macros/blob/master/CHANGELOG.md#unreleased) for more - `UpdateListener` now has an associated type `Err` instead of a generic - `AsUpdateStream` now has an associated type `StreamErr` instead of a generic diff --git a/Cargo.toml b/Cargo.toml index 07661691..01810db7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,7 +58,7 @@ full = [ [dependencies] teloxide-core = { version = "0.7.0", default-features = false } -teloxide-macros = { version = "0.6.3", optional = true } +#teloxide-macros = { version = "0.6.3", optional = true } serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } @@ -67,7 +67,7 @@ dptree = "0.3.0" # These lines are used only for development. # teloxide-core = { git = "https://github.com/teloxide/teloxide-core", rev = "b13393d", default-features = false } -# teloxide-macros = { git = "https://github.com/teloxide/teloxide-macros", rev = "44d91c5", optional = true } +teloxide-macros = { git = "https://github.com/teloxide/teloxide-macros", rev = "0e79c37", optional = true } # dptree = { git = "https://github.com/teloxide/dptree", rev = "df578e4" } tokio = { version = "1.8", features = ["fs"] } diff --git a/tests/command.rs b/tests/command.rs index 4b59ac48..d3322ea4 100644 --- a/tests/command.rs +++ b/tests/command.rs @@ -233,8 +233,8 @@ fn rename_rules() { GggGgg, #[command(rename = "SCREAMING-KEBAB-CASE")] HhhHhh, - #[command(rename = "Bar")] - Foo, + //#[command(rename = "Bar")] + //Foo, } assert_eq!(DefaultCommands::AaaAaa, DefaultCommands::parse("/aaaaaa", "").unwrap()); @@ -245,10 +245,15 @@ fn rename_rules() { assert_eq!(DefaultCommands::FffFff, DefaultCommands::parse("/FFF_FFF", "").unwrap()); assert_eq!(DefaultCommands::GggGgg, DefaultCommands::parse("/ggg-ggg", "").unwrap()); assert_eq!(DefaultCommands::HhhHhh, DefaultCommands::parse("/HHH-HHH", "").unwrap()); - assert_eq!(DefaultCommands::Foo, DefaultCommands::parse("/Bar", "").unwrap()); + //assert_eq!(DefaultCommands::Foo, DefaultCommands::parse("/Bar", + // "").unwrap()); + // assert_eq!( + // "/aaaaaa\n/BBBBBB\n/CccCcc\n/dddDdd\n/eee_eee\n/FFF_FFF\n/ggg-ggg\n/ + // HHH-HHH\n/Bar", DefaultCommands::descriptions().to_string() + // ); assert_eq!( - "/aaaaaa\n/BBBBBB\n/CccCcc\n/dddDdd\n/eee_eee\n/FFF_FFF\n/ggg-ggg\n/HHH-HHH\n/Bar", + "/aaaaaa\n/BBBBBB\n/CccCcc\n/dddDdd\n/eee_eee\n/FFF_FFF\n/ggg-ggg\n/HHH-HHH", DefaultCommands::descriptions().to_string() ); } diff --git a/tests/dialogue_state.rs b/tests/dialogue_state.rs deleted file mode 100644 index 567d8f51..00000000 --- a/tests/dialogue_state.rs +++ /dev/null @@ -1,64 +0,0 @@ -#![allow(deprecated)] - -#[cfg(feature = "macros")] -use teloxide::macros::DialogueState; -// We put tests here because macro expand in unit tests in the crate was a -// failure - -#[test] -#[cfg(feature = "macros")] -fn compile_test() { - #[allow(dead_code)] - #[derive(DialogueState, Clone)] - #[handler_out(Result<(), teloxide::RequestError>)] - enum State { - #[handler(handle_start)] - Start, - - #[handler(handle_have_data)] - HaveData(String), - } - - impl Default for State { - fn default() -> Self { - Self::Start - } - } - - async fn handle_start() -> Result<(), teloxide::RequestError> { - Ok(()) - } - - async fn handle_have_data() -> Result<(), teloxide::RequestError> { - Ok(()) - } -} - -#[test] -#[cfg(feature = "macros")] -fn compile_test_generics() { - #[allow(dead_code)] - #[derive(DialogueState, Clone)] - #[handler_out(Result<(), teloxide::RequestError>)] - enum State { - #[handler(handle_start)] - Start, - - #[handler(handle_have_data)] - HaveData(X), - } - - impl Default for State { - fn default() -> Self { - Self::Start - } - } - - async fn handle_start() -> Result<(), teloxide::RequestError> { - Ok(()) - } - - async fn handle_have_data() -> Result<(), teloxide::RequestError> { - Ok(()) - } -}