@@ -21,20 +21,18 @@ struct Test {
21
21
lock : Option < & ' static str > ,
22
22
}
23
23
24
- const TEST_REPOS : & ' static [ Test ] = & [
25
- Test {
26
- name : "cargo" ,
27
- repo : "https://github.com/rust-lang/cargo" ,
28
- sha : "7d79da08238e3d47e0bc4406155bdcc45ccb8c82" ,
29
- lock : None ,
30
- } ,
31
- Test {
32
- name : "iron" ,
33
- repo : "https://github.com/iron/iron" ,
34
- sha : "16c858ec2901e2992fe5e529780f59fa8ed12903" ,
35
- lock : Some ( include_str ! ( "lockfiles/iron-Cargo.lock" ) ) ,
36
- } ,
37
- ] ;
24
+ const TEST_REPOS : & ' static [ Test ] = & [ Test {
25
+ name : "cargo" ,
26
+ repo : "https://github.com/rust-lang/cargo" ,
27
+ sha : "7d79da08238e3d47e0bc4406155bdcc45ccb8c82" ,
28
+ lock : None ,
29
+ } ,
30
+ Test {
31
+ name : "iron" ,
32
+ repo : "https://github.com/iron/iron" ,
33
+ sha : "16c858ec2901e2992fe5e529780f59fa8ed12903" ,
34
+ lock : Some ( include_str ! ( "lockfiles/iron-Cargo.lock" ) ) ,
35
+ } ] ;
38
36
39
37
40
38
fn main ( ) {
@@ -52,8 +50,10 @@ fn test_repo(cargo: &Path, out_dir: &Path, test: &Test) {
52
50
println ! ( "testing {}" , test. repo) ;
53
51
let dir = clone_repo ( test, out_dir) ;
54
52
if let Some ( lockfile) = test. lock {
55
- File :: create ( & dir. join ( "Cargo.lock" ) ) . expect ( "" )
56
- . write_all ( lockfile. as_bytes ( ) ) . expect ( "" ) ;
53
+ File :: create ( & dir. join ( "Cargo.lock" ) )
54
+ . expect ( "" )
55
+ . write_all ( lockfile. as_bytes ( ) )
56
+ . expect ( "" ) ;
57
57
}
58
58
if !run_cargo_test ( cargo, & dir) {
59
59
panic ! ( "tests failed for {}" , test. repo) ;
@@ -65,10 +65,10 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
65
65
66
66
if !out_dir. join ( ".git" ) . is_dir ( ) {
67
67
let status = Command :: new ( "git" )
68
- . arg ( "init" )
69
- . arg ( & out_dir)
70
- . status ( )
71
- . expect ( "" ) ;
68
+ . arg ( "init" )
69
+ . arg ( & out_dir)
70
+ . status ( )
71
+ . expect ( "" ) ;
72
72
assert ! ( status. success( ) ) ;
73
73
}
74
74
@@ -77,23 +77,23 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
77
77
for depth in & [ 0 , 1 , 10 , 100 , 1000 , 100000 ] {
78
78
if * depth > 0 {
79
79
let status = Command :: new ( "git" )
80
- . arg ( "fetch" )
81
- . arg ( test. repo )
82
- . arg ( "master" )
83
- . arg ( & format ! ( "--depth={}" , depth) )
84
- . current_dir ( & out_dir)
85
- . status ( )
86
- . expect ( "" ) ;
80
+ . arg ( "fetch" )
81
+ . arg ( test. repo )
82
+ . arg ( "master" )
83
+ . arg ( & format ! ( "--depth={}" , depth) )
84
+ . current_dir ( & out_dir)
85
+ . status ( )
86
+ . expect ( "" ) ;
87
87
assert ! ( status. success( ) ) ;
88
88
}
89
89
90
90
let status = Command :: new ( "git" )
91
- . arg ( "reset" )
92
- . arg ( test. sha )
93
- . arg ( "--hard" )
94
- . current_dir ( & out_dir)
95
- . status ( )
96
- . expect ( "" ) ;
91
+ . arg ( "reset" )
92
+ . arg ( test. sha )
93
+ . arg ( "--hard" )
94
+ . current_dir ( & out_dir)
95
+ . status ( )
96
+ . expect ( "" ) ;
97
97
98
98
if status. success ( ) {
99
99
found = true ;
@@ -105,11 +105,11 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
105
105
panic ! ( "unable to find commit {}" , test. sha)
106
106
}
107
107
let status = Command :: new ( "git" )
108
- . arg ( "clean" )
109
- . arg ( "-fdx" )
110
- . current_dir ( & out_dir)
111
- . status ( )
112
- . unwrap ( ) ;
108
+ . arg ( "clean" )
109
+ . arg ( "-fdx" )
110
+ . current_dir ( & out_dir)
111
+ . status ( )
112
+ . unwrap ( ) ;
113
113
assert ! ( status. success( ) ) ;
114
114
115
115
out_dir
0 commit comments