include_dir
include_dir copied to clipboard
[Bug] Starnge get_dir and get_file behaviour
Version: 0.7.4
When iterate directory and use get_dir or get_file from a non-root Dir, I wish to use a relative path to find files, but it actually uses the path from root.
For example, I get a Dir which path is somedir(the directory includes a file named somefile), and I called get_dir("somefile") on it, the result will be None.
Here is source dir.rs, which supports why it's happening.
To make the bug more clear, this snippet added to the existing integration tests exhibits the failure.
let src = PARENT_DIR.get_dir("src").unwrap();
assert!(src.get_entry("src/lib.rs").is_some());
// fails
assert!(src.get_entry("lib.rs").is_some());
The first one passes, and should fail, and the second one fails when it should pass.