File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -363,7 +363,7 @@ fn create_worker_count(num_workers: NonZero<usize>) -> WorkerCount {
363
363
fn create_pattern ( pattern : & str ) -> Pattern {
364
364
Pattern :: new (
365
365
pattern,
366
- CaseMatching :: Smart ,
366
+ CaseMatching :: Ignore ,
367
367
Normalization :: Smart ,
368
368
AtomKind :: Fuzzy ,
369
369
)
@@ -403,4 +403,34 @@ mod tests {
403
403
404
404
assert_eq ! ( matches, expected) ;
405
405
}
406
+
407
+ #[ test]
408
+ fn lowercase_query_matches_uppercase_filename ( ) {
409
+ let mut matcher = Matcher :: new ( nucleo_matcher:: Config :: DEFAULT ) ;
410
+ let mut utf32buf = Vec :: < char > :: new ( ) ;
411
+ let haystack: Utf32Str < ' _ > = Utf32Str :: new ( "TODOS.md" , & mut utf32buf) ;
412
+ let pattern = create_pattern ( "tod" ) ;
413
+
414
+ let score = pattern. score ( haystack, & mut matcher) ;
415
+
416
+ assert ! (
417
+ score. is_some( ) ,
418
+ "expected lowercase query to match uppercase filename"
419
+ ) ;
420
+ }
421
+
422
+ #[ test]
423
+ fn lowercase_query_matches_uppercase_segment_in_path ( ) {
424
+ let mut matcher = Matcher :: new ( nucleo_matcher:: Config :: DEFAULT ) ;
425
+ let mut utf32buf = Vec :: < char > :: new ( ) ;
426
+ let haystack: Utf32Str < ' _ > = Utf32Str :: new ( "docs/TODOS.md" , & mut utf32buf) ;
427
+ let pattern = create_pattern ( "tod" ) ;
428
+
429
+ let score = pattern. score ( haystack, & mut matcher) ;
430
+
431
+ assert ! (
432
+ score. is_some( ) ,
433
+ "expected lowercase query to match uppercase segment within a path"
434
+ ) ;
435
+ }
406
436
}
You can’t perform that action at this time.
0 commit comments