@@ -119,7 +119,7 @@ mod test {
119119
120120 // Test
121121 if let Err ( msg) = check_errno ( buf. len ( ) as i32 , & mut buf) {
122- assert_eq ! ( msg, "Invalid UTF-8 sequence: invalid utf-8 sequence of 1 bytes from index 0" )
122+ assert ! ( msg. contains ( "Invalid UTF-8 sequence: invalid utf-8 sequence of 1 bytes from index 0" ) )
123123 }
124124 }
125125
@@ -130,7 +130,7 @@ mod test {
130130
131131 // Test
132132 if let Ok ( msg) = check_errno ( buf. len ( ) as i32 , & mut buf) {
133- assert_eq ! ( msg, message) ;
133+ assert ! ( msg. contains ( message) ) ;
134134 }
135135 }
136136
@@ -141,10 +141,7 @@ mod test {
141141
142142 // Test
143143 if let Err ( mes) = check_errno ( -1 , & mut buf) {
144- #[ cfg( target_os = "macos" ) ]
145- assert_eq ! ( mes, "return code = -1, errno = -1, message = 'Unknown error: -1'" ) ;
146- #[ cfg( any( target_os = "linux" , target_os = "redox" , target_os = "android" ) ) ]
147- assert_eq ! ( mes, "return code = -1, errno = -1, message = 'Unknown error -1'" ) ;
144+ assert ! ( mes. contains( "return code = -1, errno = -1" ) ) ;
148145 }
149146 }
150147
@@ -155,7 +152,7 @@ mod test {
155152
156153 // Test
157154 if let Err ( mes) = check_errno ( 0 , & mut buf) {
158- assert_eq ! ( mes, "return code = 0, errno = 2, message = 'No such file or directory'" )
155+ assert ! ( mes. contains ( "return code = 0, errno = 2" ) )
159156 }
160157 }
161158}
0 commit comments