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/src/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl<'a> Dir<'a> {
let path = path.as_ref();

for entry in self.entries() {
if entry.path() == path {
if entry.path() == self.path().join(path) {
return Some(entry);
}

Expand Down
8 changes: 8 additions & 0 deletions include_dir/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ fn extract_all_files() {
validate_extracted(&PARENT_DIR, root);
}

#[test]
fn get_entry_works_properly() {
PARENT_DIR.get_dir("src")
.expect("is 'src' deleted? please fix this.")
.get_entry("lib.rs")
.expect("check if 'lib.rs' exists, or the behaviour is not expected.");
}

// Validates that all files on the filesystem exist in the inclusion
fn validate_included(dir: &Dir<'_>, path: &Path, root: &Path) {
for entry in path.read_dir().unwrap() {
Expand Down