11#![ cfg( feature = "integration" ) ]
22
33use std:: env;
4+ use std:: ffi:: OsStr ;
45use std:: process:: Command ;
56
67#[ cfg_attr( feature = "integration" , test) ]
@@ -12,13 +13,16 @@ fn integration_test() {
1213 . nth ( 1 )
1314 . expect ( "repo name should have format `<org>/<name>`" ) ;
1415
15- let repo_dir = tempfile:: tempdir ( )
16- . expect ( "couldn't create temp dir" )
17- . path ( )
18- . join ( crate_name) ;
16+ let mut repo_dir = tempfile:: tempdir ( ) . expect ( "couldn't create temp dir" ) . into_path ( ) ;
17+ repo_dir. push ( crate_name) ;
1918
2019 let st = Command :: new ( "git" )
21- . args ( & [ "clone" , "--depth=1" , & repo_url, repo_dir. to_str ( ) . unwrap ( ) ] )
20+ . args ( & [
21+ OsStr :: new ( "clone" ) ,
22+ OsStr :: new ( "--depth=1" ) ,
23+ OsStr :: new ( & repo_url) ,
24+ OsStr :: new ( & repo_dir) ,
25+ ] )
2226 . status ( )
2327 . expect ( "unable to run git" ) ;
2428 assert ! ( st. success( ) ) ;
@@ -68,13 +72,8 @@ fn integration_test() {
6872 }
6973
7074 match output. status . code ( ) {
71- Some ( code) => {
72- if code == 0 {
73- println ! ( "Compilation successful" ) ;
74- } else {
75- eprintln ! ( "Compilation failed. Exit code: {}" , code) ;
76- }
77- } ,
75+ Some ( 0 ) => println ! ( "Compilation successful" ) ,
76+ Some ( code) => eprintln ! ( "Compilation failed. Exit code: {}" , code) ,
7877 None => panic ! ( "Process terminated by signal" ) ,
7978 }
8079}
0 commit comments