From 7e8eeec02fef882fc6083bd1a9f7923fd586cae4 Mon Sep 17 00:00:00 2001 From: scalexm Date: Fri, 25 Jun 2021 00:18:53 +0200 Subject: [PATCH] Add a test --- tests/test_methods.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test_methods.rs b/tests/test_methods.rs index 72a03681..f2382780 100644 --- a/tests/test_methods.rs +++ b/tests/test_methods.rs @@ -733,7 +733,7 @@ fn test_raw_idents() { #[pyclass] struct Issue1505 {} -macro_rules! issue_1505 { +macro_rules! pymethods { ( #[pymethods] impl $ty: ty { @@ -747,7 +747,7 @@ macro_rules! issue_1505 { }; } -issue_1505!( +pymethods!( #[pymethods] impl Issue1505 { fn issue_1505(&self, _py: Python<'_>) {} @@ -819,3 +819,13 @@ issue_1506!( } } ); + +#[pyclass] +struct Issue1696 {} + +pymethods!( + #[pymethods] + impl Issue1696 { + fn issue_1696(&self, _x: &InstanceMethod) {} + } +);