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

GlobSet: the order of patterns added to the builder matters and it shouldn't #1079

Closed
calixteman opened this issue Oct 7, 2018 · 3 comments
Labels
question An issue that is lacking clarity on one or more points.

Comments

@calixteman
Copy link

With globset 0.4.2, the following test case is failing:

extern crate globset;
use globset::{Glob, GlobSetBuilder};

fn main() {
    let mut glob_builder = GlobSetBuilder::new();	
    for i in vec!["libcore/*", "libstd/*"] {
        glob_builder.add(Glob::new(&i).unwrap());
    }
    let globset = glob_builder.build().unwrap();
	
    assert!(globset.is_match("libstd/io/buffered.rs"));
    assert!(globset.is_match("libcore/char/methods.rs"));

    let mut glob_builder = GlobSetBuilder::new();	
    for i in vec!["libstd/*", "libcore/*"] {
        glob_builder.add(Glob::new(&i).unwrap());
    }
    let globset = glob_builder.build().unwrap();
	
    assert!(globset.is_match("libstd/io/buffered.rs"));
    assert!(globset.is_match("libcore/char/methods.rs"));
}

with (this is the last assertion in the code):
'assertion failed: globset.is_match("libcore/char/methods.rs")', src/main.rs:22:5

@calixteman calixteman changed the title GlobSet: the order of patterns added to the builder matters GlobSet: the order of patterns added to the builder matters and it shouldn't Oct 7, 2018
@calixteman
Copy link
Author

@BurntSushi, any chance to have a fix for this bug ?

@BurntSushi
Copy link
Owner

@calixteman Thanks for the ping, but I haven't even had time to confirm this and I don't know when I will be able to look at fixing it.

@BurntSushi BurntSushi added the question An issue that is lacking clarity on one or more points. label Oct 19, 2018
marco-c pushed a commit to mozilla/grcov that referenced this issue Oct 30, 2018
@marco-c
Copy link

marco-c commented Mar 29, 2019

@BurntSushi could you release a new version of globset with the fix for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question An issue that is lacking clarity on one or more points.
Projects
None yet
Development

No branches or pull requests

3 participants