File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1123,12 +1123,12 @@ mod test {
1123
1123
try!( :: std:: str:: from_utf8 ( s) . context ( p) ) ;
1124
1124
Ok ( ( ) )
1125
1125
}
1126
- assert_eq ! ( format! ( "{}" , parse_utf( b"a\x80 \x80 " , "/etc" ) . unwrap_err( ) ) ,
1127
- "Path error at \" /etc \" : invalid utf-8: \
1128
- invalid byte near index 1" ) ;
1129
- assert_eq ! ( format! ( "{}" , parse_utf( b"\x80 \x80 " ,
1130
- PathBuf :: from ( "/tmp" ) ) . unwrap_err ( ) ) ,
1131
- "Path error at \" /tmp \" : invalid utf-8: \
1132
- invalid byte near index 0" ) ;
1126
+ let etext = parse_utf ( b"a\x80 \x80 " , "/etc" ) . unwrap_err ( ) . to_string ( ) ;
1127
+ assert ! ( etext . starts_with (
1128
+ "Path error at \" /etc \" : invalid utf-8: invalid " ) ) ;
1129
+ let etext = parse_utf ( b"\x80 \x80 " , PathBuf :: from ( "/tmp" ) ) . unwrap_err ( )
1130
+ . to_string ( ) ;
1131
+ assert ! ( etext . starts_with (
1132
+ "Path error at \" /tmp \" : invalid utf-8: invalid " ) ) ;
1133
1133
}
1134
1134
}
You can’t perform that action at this time.
0 commit comments