From f37d4918b18a9d3296bfc1deb270f07c805e4eec Mon Sep 17 00:00:00 2001 From: Cerber Ursi Date: Mon, 17 Jun 2024 22:17:58 +0700 Subject: [PATCH] add test to check issue #99 --- include_dir/tests/integration_test.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include_dir/tests/integration_test.rs b/include_dir/tests/integration_test.rs index bf95ba59d..9d9a302da 100644 --- a/include_dir/tests/integration_test.rs +++ b/include_dir/tests/integration_test.rs @@ -94,3 +94,13 @@ fn msrv_is_in_sync() { .unwrap(); assert_eq!(workflow_msrv, msrv); } + +#[test] +fn include_dir_conditionally() { + static CONDITIONAL_PARENT_DIR: Option> = if true { + Some(include_dir!("$CARGO_MANIFEST_DIR")) + } else { + None + }; + let _ = CONDITIONAL_PARENT_DIR.as_ref().unwrap(); +}