File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11use crate :: io:: prelude:: * ;
22
3+ use crate :: env;
34use crate :: fs:: { self , File , OpenOptions } ;
45use crate :: io:: { ErrorKind , SeekFrom } ;
56use crate :: path:: Path ;
@@ -906,7 +907,14 @@ fn read_link() {
906907 // junction
907908 assert_eq ! ( check!( fs:: read_link( r"C:\Users\Default User" ) ) , Path :: new( r"C:\Users\Default" ) ) ;
908909 // junction with special permissions
909- assert_eq ! ( check!( fs:: read_link( r"C:\Documents and Settings\" ) ) , Path :: new( r"C:\Users" ) ) ;
910+ // Since not all localized windows versions contain the folder "Documents and Settings" in english,
911+ // we will briefly check, if it exists and otherwise skip the test. Except during CI we will always execute the test.
912+ if Path :: new ( r"C:\Documents and Settings\" ) . exists ( ) || env:: var_os ( "CI" ) . is_some ( ) {
913+ assert_eq ! (
914+ check!( fs:: read_link( r"C:\Documents and Settings\" ) ) ,
915+ Path :: new( r"C:\Users" )
916+ ) ;
917+ }
910918 }
911919 let tmpdir = tmpdir ( ) ;
912920 let link = tmpdir. join ( "link" ) ;
You can’t perform that action at this time.
0 commit comments