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(); +}