Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Starnge get_dir and get_file behaviour #104

Open
zerodegress opened this issue Jul 5, 2024 · 1 comment
Open

[Bug] Starnge get_dir and get_file behaviour #104

zerodegress opened this issue Jul 5, 2024 · 1 comment

Comments

@zerodegress
Copy link

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

@marshallpierce
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants