Skip to content

Commit

Permalink
update tests and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xalpharush committed Jul 4, 2023
1 parent fbef88d commit 1b35170
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ impl FromStr for SkipBuildFilter {
impl FileFilter for SkipBuildFilter {
/// Matches file only if the filter does not apply
///
/// This is returns the inverse of `file.name.contains(pattern)`
/// This is returns the inverse of `file.name.contains(pattern) || matcher.is_match(file)`
fn is_match(&self, file: &Path) -> bool {
fn exclude(file: &Path, pattern: &str) -> Option<bool> {
let matcher: GlobMatcher = pattern.parse().unwrap();
Expand Down Expand Up @@ -553,9 +553,9 @@ mod tests {
assert!(!SkipBuildFilter::Scripts.is_match(file));
assert!(!SkipBuildFilter::Custom("A.s".to_string()).is_match(file));

let file = Path::new("/private/var/folders/test/Foo.sol");
let file = Path::new("/home/test/Foo.sol");
assert!(!SkipBuildFilter::Custom("*/test/**".to_string()).is_match(file));
let file = Path::new("script/Contract.sol");
let file = Path::new("/home/script/Contract.sol");
assert!(!SkipBuildFilter::Custom("*/script/**".to_string()).is_match(file));
}
}

0 comments on commit 1b35170

Please sign in to comment.