Skip to content

Commit

Permalink
add test for recursive detection
Browse files Browse the repository at this point in the history
Coverage information suggested that recursive files weren't covered.
  • Loading branch information
sunshowers committed Dec 25, 2024
1 parent 2c7011c commit 42c1f79
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
7 changes: 4 additions & 3 deletions tests/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ datatest_stable::harness!(
// ---
with_contents::test_artifact_string,
maybe_include_dir!(),
// This regex matches exactly a.txt, b.txt, and c.skip.txt -- this ensures
// that patterns are relative to the include dir and not the crate root
r"^(a|b|c\.skip)\.txt$",
// This regex matches exactly dir/a.txt, b.txt, and c.skip.txt -- this
// ensures that patterns are relative to the include dir and not the crate
// root
r"^(dir/a|b|c\.skip)\.txt$",
// ---
with_contents::test_artifact_utf8_string,
&with_contents::MAYBE_INCLUDE_STATIC, // Test out some combinations with &'static include_dir::Dir.
Expand Down
File renamed without changes.
24 changes: 12 additions & 12 deletions tests/run_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
// SPDX-License-Identifier: MIT OR Apache-2.0

static EXPECTED_LINES: &[&str] = &[
"datatest-stable::example test_artifact_utf8::a.txt",
"datatest-stable::example test_artifact_utf8::dir/a.txt",
"datatest-stable::example test_artifact_utf8::b.txt",
"datatest-stable::example test_artifact_utf8::c.skip.txt",
"datatest-stable::example test_artifact::a.txt",
"datatest-stable::example test_artifact::dir/a.txt",
"datatest-stable::example test_artifact::b.txt",
"datatest-stable::example with_contents::test_artifact_bytes::a.txt",
"datatest-stable::example with_contents::test_artifact_bytes::dir/a.txt",
"datatest-stable::example with_contents::test_artifact_bytes::b.txt",
"datatest-stable::example with_contents::test_artifact_bytes::c.skip.txt",
"datatest-stable::example with_contents::test_artifact_string::a.txt",
"datatest-stable::example with_contents::test_artifact_string::dir/a.txt",
"datatest-stable::example with_contents::test_artifact_string::b.txt",
"datatest-stable::example with_contents::test_artifact_string::c.skip.txt",
"datatest-stable::example with_contents::test_artifact_utf8_bytes::a.txt",
"datatest-stable::example with_contents::test_artifact_utf8_bytes::dir/a.txt",
"datatest-stable::example with_contents::test_artifact_utf8_bytes::b.txt",
"datatest-stable::example with_contents::test_artifact_utf8_bytes::c.skip.txt",
"datatest-stable::example with_contents::test_artifact_utf8_string::a.txt",
"datatest-stable::example with_contents::test_artifact_utf8_string::dir/a.txt",
"datatest-stable::example with_contents::test_artifact_utf8_string::b.txt",
"datatest-stable::example with_contents::test_artifact_utf8_string::c.skip.txt",
];
Expand Down Expand Up @@ -60,29 +60,29 @@ mod unix {
static EXPECTED_UNIX_LINES: &[&str] = &[
"datatest-stable::example test_artifact_utf8::::colon::dir/::.txt",
"datatest-stable::example test_artifact_utf8::::colon::dir/a.txt",
"datatest-stable::example test_artifact_utf8::a.txt",
"datatest-stable::example test_artifact_utf8::dir/a.txt",
"datatest-stable::example test_artifact_utf8::b.txt",
"datatest-stable::example test_artifact_utf8::c.skip.txt",
"datatest-stable::example test_artifact::::colon::dir/::.txt",
"datatest-stable::example test_artifact::::colon::dir/a.txt",
"datatest-stable::example test_artifact::a.txt",
"datatest-stable::example test_artifact::dir/a.txt",
"datatest-stable::example test_artifact::b.txt",
"datatest-stable::example with_contents::test_artifact_bytes::::colon::dir/::.txt",
"datatest-stable::example with_contents::test_artifact_bytes::::colon::dir/a.txt",
"datatest-stable::example with_contents::test_artifact_bytes::a.txt",
"datatest-stable::example with_contents::test_artifact_bytes::dir/a.txt",
"datatest-stable::example with_contents::test_artifact_bytes::b.txt",
"datatest-stable::example with_contents::test_artifact_bytes::c.skip.txt",
"datatest-stable::example with_contents::test_artifact_string::a.txt",
"datatest-stable::example with_contents::test_artifact_string::dir/a.txt",
"datatest-stable::example with_contents::test_artifact_string::b.txt",
"datatest-stable::example with_contents::test_artifact_string::c.skip.txt",
"datatest-stable::example with_contents::test_artifact_utf8_bytes::::colon::dir/::.txt",
"datatest-stable::example with_contents::test_artifact_utf8_bytes::::colon::dir/a.txt",
"datatest-stable::example with_contents::test_artifact_utf8_bytes::a.txt",
"datatest-stable::example with_contents::test_artifact_utf8_bytes::dir/a.txt",
"datatest-stable::example with_contents::test_artifact_utf8_bytes::b.txt",
"datatest-stable::example with_contents::test_artifact_utf8_bytes::c.skip.txt",
"datatest-stable::example with_contents::test_artifact_utf8_string::::colon::dir/::.txt",
"datatest-stable::example with_contents::test_artifact_utf8_string::::colon::dir/a.txt",
"datatest-stable::example with_contents::test_artifact_utf8_string::a.txt",
"datatest-stable::example with_contents::test_artifact_utf8_string::dir/a.txt",
"datatest-stable::example with_contents::test_artifact_utf8_string::b.txt",
"datatest-stable::example with_contents::test_artifact_utf8_string::c.skip.txt",
];
Expand Down

0 comments on commit 42c1f79

Please sign in to comment.