From 8c232bce88264c43757bd355890618e2a7729bb0 Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Wed, 25 Sep 2024 18:04:38 -0700 Subject: [PATCH] Add a test for invalid base_dir value --- rstest_macros/src/parse/rstest/files.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rstest_macros/src/parse/rstest/files.rs b/rstest_macros/src/parse/rstest/files.rs index 5845482..c6105d1 100644 --- a/rstest_macros/src/parse/rstest/files.rs +++ b/rstest_macros/src/parse/rstest/files.rs @@ -742,6 +742,10 @@ mod should { r#"fn f(#[files("some")] #[base_dir = "/"] #[base_dir = "/"] a: PathBuf) {}"#, "more than once" )] + #[case::invalid_base_dir( + r#"fn f(#[files("some")] #[base_dir = 123] a: PathBuf) {}"#, + "base directory for the glob path" + )] fn raise_error(#[case] item_fn: &str, #[case] message: &str) { let mut item_fn: ItemFn = item_fn.ast();