From 5ad7e3fd61086d648ed17a9998653017ab56423f Mon Sep 17 00:00:00 2001 From: michele Date: Sun, 27 Nov 2022 15:15:59 +0100 Subject: [PATCH] #160 Add test for module annotation --- rstest_macros/src/render/test.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rstest_macros/src/render/test.rs b/rstest_macros/src/render/test.rs index 9a27aee..0b4bdd0 100644 --- a/rstest_macros/src/render/test.rs +++ b/rstest_macros/src/render/test.rs @@ -1290,6 +1290,20 @@ mod matrix_cases_should { } } + #[test] + fn annotate_modules_with_allow_non_snake_name() { + let (_, item_fn, info) = fixture(); + let non_snake_case = &attrs("#[allow(non_snake_case)]")[0]; + + let tokens = matrix(item_fn, info); + + let modules = TestsGroup::from(tokens).module.get_modules(); + + for module in modules { + assert!(module.attrs.contains(&non_snake_case)); + } + } + #[test] fn create_all_tests() { let (_, item_fn, info) = fixture();