@@ -112,7 +112,7 @@ impl Fzf {
112112 pub fn spawn ( & mut self ) -> Result < FzfChild > {
113113 match self . 0 . spawn ( ) {
114114 Ok ( child) => Ok ( FzfChild ( child) ) ,
115- Err ( e) if e. kind ( ) == io:: ErrorKind :: NotFound => bail ! ( Self :: ERR_FZF_NOT_FOUND ) ,
115+ Err ( e) if e. kind ( ) == io:: ErrorKind :: NotFound => Err ( anyhow ! ( Self :: ERR_FZF_NOT_FOUND ) ) ,
116116 Err ( e) => Err ( e) . context ( "could not launch fzf" ) ,
117117 }
118118 }
@@ -410,38 +410,3 @@ pub fn to_lowercase(s: impl AsRef<str>) -> String {
410410 let s = s. as_ref ( ) ;
411411 if s. is_ascii ( ) { s. to_ascii_lowercase ( ) } else { s. to_lowercase ( ) }
412412}
413-
414- #[ cfg( test) ]
415- #[ cfg( windows) ]
416- mod tests_win {
417- use std:: path:: PathBuf ;
418-
419- use rstest:: rstest;
420-
421- #[ rstest]
422- #[ case( r"c:\" , r"C:\" ) ]
423- #[ case( r"C:\" , r"C:\" ) ]
424- #[ case( r"c:\\." , r"C:\" ) ]
425- #[ case( r"c:\.." , r"C:\" ) ]
426- #[ case( r"C:\.\." , r"C:\" ) ]
427- #[ case( r"\\?\C:\" , r"C:\" ) ]
428- #[ case( r"\\?\c:\" , r"C:\" ) ]
429- #[ case( r"\\?\C:\\\" , r"C:\" ) ]
430- #[ case( r"\\?\c:\\.\" , r"C:\" ) ]
431- #[ case( r"c:\Windows" , r"C:\Windows" ) ]
432- #[ case( r"C:\WINDOWS" , r"C:\WINDOWS" ) ]
433- #[ case( r"c:\\\Windows\." , r"C:\Windows" ) ]
434- #[ case( r"C:\$WinREAgent" , r"C:\$WinREAgent" ) ]
435- #[ case( r"\\?\c:\\Windows\\." , r"C:\Windows" ) ]
436- #[ case( r"\\?\c:\..\.\windows" , r"C:\windows" ) ]
437- #[ case( r"c:\Windows\System32\." , r"C:\Windows\System32" ) ]
438- #[ case( r"c:\WINDOWS\..\..\Windows" , r"C:\Windows" ) ]
439- #[ case( r"c:\Windows\..\.\.\..\Temp\..\tmp" , r"C:\tmp" ) ]
440- #[ case( r"c:\.\Windows\..\..\Program Files" , r"C:\Program Files" ) ]
441- #[ case( r"\\?\C:\\$WinREAgent\\..\Program Files\." , r"C:\Program Files" ) ]
442- fn resolve_path ( #[ case] absolute_path : & str , #[ case] normalized_form : & str ) {
443- let path = PathBuf :: from ( absolute_path) ;
444- let resolved_path = super :: resolve_path ( path) . unwrap ( ) ;
445- assert_eq ! ( resolved_path. to_str( ) . unwrap( ) , normalized_form) ;
446- }
447- }
0 commit comments