@@ -27,13 +27,13 @@ fn mock_smoke_test() {
27
27
vec![ MockCommand :: File ( "bin/foo" . to_string( ) ) ,
28
28
MockCommand :: File ( "lib/bar" . to_string( ) ) ,
29
29
MockCommand :: Dir ( "doc/stuff" . to_string( ) ) ] ,
30
- vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) ) ,
31
- ( "lib/bar" . to_string( ) , "bar" . into( ) ) ,
32
- ( "doc/stuff/doc1" . to_string( ) , "" . into( ) ) ,
33
- ( "doc/stuff/doc2" . to_string( ) , "" . into( ) ) ] ) ,
30
+ vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) , false ) ,
31
+ ( "lib/bar" . to_string( ) , "bar" . into( ) , false ) ,
32
+ ( "doc/stuff/doc1" . to_string( ) , "" . into( ) , false ) ,
33
+ ( "doc/stuff/doc2" . to_string( ) , "" . into( ) , false ) ] ) ,
34
34
( "mycomponent2" . to_string( ) ,
35
35
vec![ MockCommand :: File ( "bin/quux" . to_string( ) ) ] ,
36
- vec![ ( "bin/quux" . to_string( ) , "quux" . into( ) ) ]
36
+ vec![ ( "bin/quux" . to_string( ) , "quux" . into( ) , false ) ]
37
37
) ]
38
38
} ;
39
39
@@ -56,11 +56,11 @@ fn package_contains() {
56
56
let mock = MockInstallerBuilder {
57
57
components : vec ! [ ( "mycomponent" . to_string( ) ,
58
58
vec![ MockCommand :: File ( "bin/foo" . to_string( ) ) ] ,
59
- vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) ) ] ,
59
+ vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) , false ) ] ,
60
60
) ,
61
61
( "mycomponent2" . to_string( ) ,
62
62
vec![ MockCommand :: File ( "bin/bar" . to_string( ) ) ] ,
63
- vec![ ( "bin/bar" . to_string( ) , "bar" . into( ) ) ]
63
+ vec![ ( "bin/bar" . to_string( ) , "bar" . into( ) , false ) ]
64
64
) ]
65
65
} ;
66
66
@@ -78,7 +78,7 @@ fn package_bad_version() {
78
78
let mock = MockInstallerBuilder {
79
79
components : vec ! [ ( "mycomponent" . to_string( ) ,
80
80
vec![ MockCommand :: File ( "bin/foo" . to_string( ) ) ] ,
81
- vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) ) ] ) ]
81
+ vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) , false ) ] ) ]
82
82
} ;
83
83
84
84
mock. build ( tempdir. path ( ) ) ;
@@ -98,10 +98,10 @@ fn basic_install() {
98
98
vec![ MockCommand :: File ( "bin/foo" . to_string( ) ) ,
99
99
MockCommand :: File ( "lib/bar" . to_string( ) ) ,
100
100
MockCommand :: Dir ( "doc/stuff" . to_string( ) ) ] ,
101
- vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) ) ,
102
- ( "lib/bar" . to_string( ) , "bar" . into( ) ) ,
103
- ( "doc/stuff/doc1" . to_string( ) , "" . into( ) ) ,
104
- ( "doc/stuff/doc2" . to_string( ) , "" . into( ) ) ] ) ]
101
+ vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) , false ) ,
102
+ ( "lib/bar" . to_string( ) , "bar" . into( ) , false ) ,
103
+ ( "doc/stuff/doc1" . to_string( ) , "" . into( ) , false ) ,
104
+ ( "doc/stuff/doc2" . to_string( ) , "" . into( ) , false ) ] ) ]
105
105
} ;
106
106
107
107
mock. build ( pkgdir. path ( ) ) ;
@@ -136,10 +136,10 @@ fn multiple_component_install() {
136
136
let mock = MockInstallerBuilder {
137
137
components : vec ! [ ( "mycomponent" . to_string( ) ,
138
138
vec![ MockCommand :: File ( "bin/foo" . to_string( ) ) ] ,
139
- vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) ) ] ) ,
139
+ vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) , false ) ] ) ,
140
140
( "mycomponent2" . to_string( ) ,
141
141
vec![ MockCommand :: File ( "lib/bar" . to_string( ) ) ] ,
142
- vec![ ( "lib/bar" . to_string( ) , "bar" . into( ) ) ] ) ]
142
+ vec![ ( "lib/bar" . to_string( ) , "bar" . into( ) , false ) ] ) ]
143
143
} ;
144
144
145
145
mock. build ( pkgdir. path ( ) ) ;
@@ -176,13 +176,13 @@ fn uninstall() {
176
176
vec![ MockCommand :: File ( "bin/foo" . to_string( ) ) ,
177
177
MockCommand :: File ( "lib/bar" . to_string( ) ) ,
178
178
MockCommand :: Dir ( "doc/stuff" . to_string( ) ) ] ,
179
- vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) ) ,
180
- ( "lib/bar" . to_string( ) , "bar" . into( ) ) ,
181
- ( "doc/stuff/doc1" . to_string( ) , "" . into( ) ) ,
182
- ( "doc/stuff/doc2" . to_string( ) , "" . into( ) ) ] ) ,
179
+ vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) , false ) ,
180
+ ( "lib/bar" . to_string( ) , "bar" . into( ) , false ) ,
181
+ ( "doc/stuff/doc1" . to_string( ) , "" . into( ) , false ) ,
182
+ ( "doc/stuff/doc2" . to_string( ) , "" . into( ) , false ) ] ) ,
183
183
( "mycomponent2" . to_string( ) ,
184
184
vec![ MockCommand :: File ( "lib/quux" . to_string( ) ) ] ,
185
- vec![ ( "lib/quux" . to_string( ) , "quux" . into( ) ) ] ) ]
185
+ vec![ ( "lib/quux" . to_string( ) , "quux" . into( ) , false ) ] ) ]
186
186
} ;
187
187
188
188
mock. build ( pkgdir. path ( ) ) ;
@@ -234,7 +234,7 @@ fn component_bad_version() {
234
234
let mock = MockInstallerBuilder {
235
235
components : vec ! [ ( "mycomponent" . to_string( ) ,
236
236
vec![ MockCommand :: File ( "bin/foo" . to_string( ) ) ] ,
237
- vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) ) ] ) ]
237
+ vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) , false ) ] ) ]
238
238
} ;
239
239
240
240
mock. build ( pkgdir. path ( ) ) ;
@@ -276,11 +276,14 @@ fn unix_permissions() {
276
276
components : vec ! [ ( "mycomponent" . to_string( ) ,
277
277
vec![ MockCommand :: File ( "bin/foo" . to_string( ) ) ,
278
278
MockCommand :: File ( "lib/bar" . to_string( ) ) ,
279
+ MockCommand :: File ( "lib/foobar" . to_string( ) ) ,
279
280
MockCommand :: Dir ( "doc/stuff" . to_string( ) ) ] ,
280
- vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) ) ,
281
- ( "lib/bar" . to_string( ) , "bar" . into( ) ) ,
282
- ( "doc/stuff/doc1" . to_string( ) , "" . into( ) ) ,
283
- ( "doc/stuff/morestuff/doc2" . to_string( ) , "" . into( ) ) ] ) ]
281
+ vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) , false ) ,
282
+ ( "lib/bar" . to_string( ) , "bar" . into( ) , false ) ,
283
+ ( "lib/foobar" . to_string( ) , "foobar" . into( ) , true ) ,
284
+ ( "doc/stuff/doc1" . to_string( ) , "" . into( ) , false ) ,
285
+ ( "doc/stuff/morestuff/doc2" . to_string( ) , "" . into( ) , false ) ,
286
+ ( "doc/stuff/morestuff/tool" . to_string( ) , "" . into( ) , true ) ] ) ]
284
287
} ;
285
288
286
289
mock. build ( pkgdir. path ( ) ) ;
@@ -304,6 +307,8 @@ fn unix_permissions() {
304
307
assert_eq ! ( m, 0o755 ) ;
305
308
let m = fs:: metadata ( instdir. path ( ) . join ( "lib/bar" ) ) . unwrap ( ) . permissions ( ) . mode ( ) ;
306
309
assert_eq ! ( m, 0o644 ) ;
310
+ let m = fs:: metadata ( instdir. path ( ) . join ( "lib/foobar" ) ) . unwrap ( ) . permissions ( ) . mode ( ) ;
311
+ assert_eq ! ( m, 0o755 ) ;
307
312
let m = fs:: metadata ( instdir. path ( ) . join ( "doc/stuff/" ) ) . unwrap ( ) . permissions ( ) . mode ( ) ;
308
313
assert_eq ! ( m, 0o755 ) ;
309
314
let m = fs:: metadata ( instdir. path ( ) . join ( "doc/stuff/doc1" ) ) . unwrap ( ) . permissions ( ) . mode ( ) ;
@@ -312,6 +317,8 @@ fn unix_permissions() {
312
317
assert_eq ! ( m, 0o755 ) ;
313
318
let m = fs:: metadata ( instdir. path ( ) . join ( "doc/stuff/morestuff/doc2" ) ) . unwrap ( ) . permissions ( ) . mode ( ) ;
314
319
assert_eq ! ( m, 0o644 ) ;
320
+ let m = fs:: metadata ( instdir. path ( ) . join ( "doc/stuff/morestuff/tool" ) ) . unwrap ( ) . permissions ( ) . mode ( ) ;
321
+ assert_eq ! ( m, 0o755 ) ;
315
322
}
316
323
317
324
// Installing to a prefix that doesn't exist creates it automatically
@@ -322,7 +329,7 @@ fn install_to_prefix_that_does_not_exist() {
322
329
let mock = MockInstallerBuilder {
323
330
components : vec ! [ ( "mycomponent" . to_string( ) ,
324
331
vec![ MockCommand :: File ( "bin/foo" . to_string( ) ) ] ,
325
- vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) ) ] ) ]
332
+ vec![ ( "bin/foo" . to_string( ) , "foo" . into( ) , false ) ] ) ]
326
333
} ;
327
334
328
335
mock. build ( pkgdir. path ( ) ) ;
0 commit comments