Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include_dir/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Michael Bryan <michaelfbryan@gmail.com>"]
name = "include_dir"
version = "0.7.3"
version = "0.7.4"
description = "Embed the contents of a directory in your binary"
license = "MIT"
readme = "README.md"
Expand Down
14 changes: 7 additions & 7 deletions include_dir/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ use include_dir::{include_dir, Dir};
use std::path::Path;
use tempfile::TempDir;

static PARENT_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR");
static PARENT_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/tests/tree");

#[test]
fn included_all_files_in_the_include_dir_crate() {
let root = Path::new(env!("CARGO_MANIFEST_DIR"));
let root = &Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/tree");

validate_included(&PARENT_DIR, root, root);
assert!(PARENT_DIR.contains("src/lib.rs"));
assert!(PARENT_DIR.contains("a/i/x"));
}

#[test]
Expand Down Expand Up @@ -46,14 +46,14 @@ fn validate_included(dir: &Dir<'_>, path: &Path, root: &Path) {
fn validate_extracted(dir: &Dir, path: &Path) {
// Check if all the subdirectories exist, recursing on each
for subdir in dir.dirs() {
let subdir_path = path.join(dir.path());
assert!(subdir_path.exists());
validate_extracted(subdir, &subdir_path);
let subdir_path = path.join(subdir.path());
assert!(subdir_path.exists(), "Can't find {}", subdir_path.display());
validate_extracted(subdir, path);
}

// Check if the files at the root of this directory exist
for file in dir.files() {
let file_path = path.join(file.path());
assert!(file_path.exists());
assert!(file_path.exists(), "Can't find {}", file_path.display());
}
}
Empty file added include_dir/tests/tree/a/i/x
Empty file.
Empty file added include_dir/tests/tree/a/i/y
Empty file.
Empty file added include_dir/tests/tree/a/i/z
Empty file.
Empty file added include_dir/tests/tree/a/j
Empty file.
Empty file added include_dir/tests/tree/a/k
Empty file.
Empty file added include_dir/tests/tree/b
Empty file.
Empty file added include_dir/tests/tree/c
Empty file.