File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -83,9 +83,6 @@ mod tests {
8383 use crate :: sync:: tests:: repo_init_with_prefix;
8484
8585 fn repo_init ( ) -> Result < ( TempDir , Repository ) > {
86- #[ allow( dead_code) ]
87- const INVALID_UTF8 : & [ u8 ] = b"\xED \xA0 \x80 " ;
88-
8986 let mut os_string: OsString = OsString :: new ( ) ;
9087
9188 os_string. push ( "gitui $# ' " ) ;
@@ -94,24 +91,25 @@ mod tests {
9491 {
9592 use std:: os:: windows:: ffi:: OsStringExt ;
9693
97- let invalid_utf8 = INVALID_UTF8
98- . into_iter ( )
99- . map ( |b| * b as u16 )
100- . collect :: < Vec < u16 > > ( ) ;
94+ const INVALID_UTF16 : & [ u16 ] = & [ 0xD83D ] ;
10195
102- os_string. push ( OsString :: from_wide ( & invalid_utf8 ) ) ;
96+ os_string. push ( OsString :: from_wide ( INVALID_UTF16 ) ) ;
10397
10498 assert ! ( os_string. to_str( ) . is_none( ) ) ;
10599 }
106100 #[ cfg( target_os = "linux" ) ]
107101 {
108102 use std:: os:: unix:: ffi:: OsStrExt ;
109103
104+ const INVALID_UTF8 : & [ u8 ] = b"\xED \xA0 \x80 " ;
105+
110106 os_string. push ( std:: ffi:: OsStr :: from_bytes ( INVALID_UTF8 ) ) ;
111107
112108 assert ! ( os_string. to_str( ) . is_none( ) ) ;
113109 }
114110
111+ os_string. push ( " " ) ;
112+
115113 repo_init_with_prefix ( os_string)
116114 }
117115
You can’t perform that action at this time.
0 commit comments