@@ -143,7 +143,7 @@ fn run_git(args: &[~str], env: Option<~[(~str, ~str)]>, cwd: &Path, err_msg: &st
143
143
let rslt = prog. finish_with_output ( ) ;
144
144
if !rslt. status . success ( ) {
145
145
fail ! ( "{} [git returned {:?}, output = {}, error = {}]" , err_msg,
146
- rslt. status, str :: from_utf8( rslt. output) , str :: from_utf8( rslt. error) ) ;
146
+ rslt. status, str :: from_utf8( rslt. output) . unwrap ( ) , str :: from_utf8( rslt. error) . unwrap ( ) ) ;
147
147
}
148
148
}
149
149
@@ -279,13 +279,13 @@ fn command_line_test_with_env(args: &[~str], cwd: &Path, env: Option<~[(~str, ~s
279
279
} ) . expect ( format ! ( "failed to exec `{}`" , cmd) ) ;
280
280
let output = prog. finish_with_output ( ) ;
281
281
debug ! ( "Output from command {} with args {:?} was {} \\ {{}\\ }[{:?}]" ,
282
- cmd, args, str :: from_utf8( output. output) ,
283
- str :: from_utf8( output. error) ,
282
+ cmd, args, str :: from_utf8( output. output) . unwrap ( ) ,
283
+ str :: from_utf8( output. error) . unwrap ( ) ,
284
284
output. status) ;
285
285
if !output. status . success ( ) {
286
286
debug ! ( "Command {} {:?} failed with exit code {:?}; its output was --- {} {} ---" ,
287
287
cmd, args, output. status,
288
- str :: from_utf8( output. output) , str :: from_utf8( output. error) ) ;
288
+ str :: from_utf8( output. output) . unwrap ( ) , str :: from_utf8( output. error) . unwrap ( ) ) ;
289
289
Fail ( output)
290
290
}
291
291
else {
@@ -445,7 +445,7 @@ fn built_library_exists(repo: &Path, short_name: &str) -> bool {
445
445
fn command_line_test_output ( args : & [ ~str ] ) -> ~[ ~str ] {
446
446
let mut result = ~[ ] ;
447
447
let p_output = command_line_test ( args, & os:: getcwd ( ) ) ;
448
- let test_output = str:: from_utf8 ( p_output. output ) ;
448
+ let test_output = str:: from_utf8 ( p_output. output ) . unwrap ( ) ;
449
449
for s in test_output. split ( '\n' ) {
450
450
result. push ( s. to_owned ( ) ) ;
451
451
}
@@ -459,7 +459,7 @@ fn command_line_test_output_with_env(args: &[~str], env: ~[(~str, ~str)]) -> ~[~
459
459
Fail ( _) => fail ! ( "Command-line test failed" ) ,
460
460
Success ( r) => r
461
461
} ;
462
- let test_output = str:: from_utf8 ( p_output. output ) ;
462
+ let test_output = str:: from_utf8 ( p_output. output ) . unwrap ( ) ;
463
463
for s in test_output. split ( '\n' ) {
464
464
result. push ( s. to_owned ( ) ) ;
465
465
}
@@ -1199,7 +1199,7 @@ fn test_uninstall() {
1199
1199
let workspace = create_local_package(&CrateId::new(" foo"));
1200
1200
command_line_test([~" uninstall", ~" foo"], workspace.path());
1201
1201
let output = command_line_test([~" list"], workspace.path());
1202
- assert!(!str::from_utf8(output.output).contains(" foo"));
1202
+ assert!(!str::from_utf8(output.output).unwrap(). contains(" foo"));
1203
1203
}
1204
1204
1205
1205
#[test]
@@ -1269,8 +1269,8 @@ fn test_extern_mod() {
1269
1269
let outp = prog. finish_with_output ( ) ;
1270
1270
if !outp. status . success ( ) {
1271
1271
fail ! ( "output was {}, error was {}" ,
1272
- str :: from_utf8( outp. output) ,
1273
- str :: from_utf8( outp. error) ) ;
1272
+ str :: from_utf8( outp. output) . unwrap ( ) ,
1273
+ str :: from_utf8( outp. error) . unwrap ( ) ) ;
1274
1274
}
1275
1275
assert ! ( exec_file. exists( ) && is_executable( & exec_file) ) ;
1276
1276
}
@@ -1324,8 +1324,8 @@ fn test_extern_mod_simpler() {
1324
1324
let outp = prog. finish_with_output ( ) ;
1325
1325
if !outp. status . success ( ) {
1326
1326
fail ! ( "output was {}, error was {}" ,
1327
- str :: from_utf8( outp. output) ,
1328
- str :: from_utf8( outp. error) ) ;
1327
+ str :: from_utf8( outp. output) . unwrap ( ) ,
1328
+ str :: from_utf8( outp. error) . unwrap ( ) ) ;
1329
1329
}
1330
1330
assert ! ( exec_file. exists( ) && is_executable( & exec_file) ) ;
1331
1331
}
@@ -2092,7 +2092,7 @@ fn test_rustpkg_test_creates_exec() {
2092
2092
fn test_rustpkg_test_output() {
2093
2093
let workspace = create_local_package_with_test(&CrateId::new(" foo"));
2094
2094
let output = command_line_test([~" test", ~" foo"], workspace.path());
2095
- let output_str = str::from_utf8(output.output);
2095
+ let output_str = str::from_utf8(output.output).unwrap() ;
2096
2096
// The first two assertions are separate because test output may
2097
2097
// contain color codes, which could appear between " test f" and " ok".
2098
2098
assert!(output_str.contains(" test f"));
@@ -2123,7 +2123,7 @@ fn test_rustpkg_test_cfg() {
2123
2123
" #[ test] #[ cfg( not( foobar) ) ] fn f( ) { assert!( 'a' != 'a' ) ; } ");
2124
2124
let output = command_line_test([~" test", ~" --cfg", ~" foobar", ~" foo"],
2125
2125
foo_workspace);
2126
- let output_str = str::from_utf8(output.output);
2126
+ let output_str = str::from_utf8(output.output).unwrap() ;
2127
2127
assert!(output_str.contains(" 0 passed; 0 failed; 0 ignored; 0 measured"));
2128
2128
}
2129
2129
@@ -2424,8 +2424,8 @@ fn correct_error_dependency() {
2424
2424
Fail(ProcessOutput{ error: error, output: output, .. }) => {
2425
2425
assert!(str::is_utf8(error));
2426
2426
assert!(str::is_utf8(output));
2427
- let error_str = str::from_utf8(error);
2428
- let out_str = str::from_utf8(output);
2427
+ let error_str = str::from_utf8(error).unwrap() ;
2428
+ let out_str = str::from_utf8(output).unwrap() ;
2429
2429
debug!(" ss = { } ", error_str);
2430
2430
debug!(" out_str = { } ", out_str);
2431
2431
if out_str.contains(" Package badpkg depends on some_package_that_doesnt_exist") &&
0 commit comments