include_dir icon indicating copy to clipboard operation
include_dir copied to clipboard

[Bug] Starnge get_dir and get_file behaviour

Open zerodegress opened this issue 1 year ago • 1 comments

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. 图片

zerodegress avatar Jul 05 '24 12:07 zerodegress

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.

marshallpierce avatar Nov 05 '24 00:11 marshallpierce