File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -125,11 +125,21 @@ mod test {
125
125
}
126
126
127
127
128
+ fn test_cache ( dir : & ' static str , pats : Vec < & str > ) -> IgnoreCache {
129
+ IgnoreCache { entries : RwLock :: new ( vec ! [ ( dir. into( ) , IgnorePatterns :: parse_from_iter( pats. into_iter( ) ) . 0 ) ] ) }
130
+ }
128
131
129
132
#[ test]
130
133
fn an_empty_cache_ignores_nothing ( ) {
131
134
let ignores = IgnoreCache :: default ( ) ;
132
135
assert_eq ! ( false , ignores. is_ignored( Path :: new( "/usr/bin/drinking" ) ) ) ;
133
136
assert_eq ! ( false , ignores. is_ignored( Path :: new( "target/debug/exa" ) ) ) ;
134
137
}
138
+
139
+ #[ test]
140
+ fn a_nonempty_cache_ignores_some_things ( ) {
141
+ let ignores = test_cache ( "/vagrant" , vec ! [ "target" ] ) ;
142
+ assert_eq ! ( false , ignores. is_ignored( Path :: new( "/vagrant/src" ) ) ) ;
143
+ assert_eq ! ( true , ignores. is_ignored( Path :: new( "/vagrant/target" ) ) ) ;
144
+ }
135
145
}
You can’t perform that action at this time.
0 commit comments