File tree 3 files changed +42
-1
lines changed
3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,16 @@ impl InputAction {
339
339
340
340
let built_binary_path = platform:: binary_cache_path ( )
341
341
. join ( if release_mode { "release" } else { "debug" } )
342
- . join ( & self . bin_name ) ;
342
+ . join ( {
343
+ #[ cfg( windows) ]
344
+ {
345
+ format ! ( "{}.exe" , & self . bin_name)
346
+ }
347
+ #[ cfg( not( windows) ) ]
348
+ {
349
+ & self . bin_name
350
+ }
351
+ } ) ;
343
352
344
353
let manifest_path = self . manifest_path ( ) ;
345
354
Original file line number Diff line number Diff line change
1
+ let msg = option_env ! ( "_RUST_SCRIPT_TEST_MESSAGE" ) . unwrap_or ( "undefined" ) ;
2
+
3
+ println ! ( "--output--" ) ;
4
+ println ! ( "msg = {}" , msg) ;
Original file line number Diff line number Diff line change @@ -186,6 +186,34 @@ fn test_whitespace_before_main() {
186
186
. unwrap ( )
187
187
}
188
188
189
+ #[ test]
190
+ fn test_force_rebuild ( ) {
191
+ for option in [ "-f" , "--force" ] {
192
+ std:: env:: remove_var ( "_RUST_SCRIPT_TEST_MESSAGE" ) ;
193
+
194
+ let script_path = "tests/data/script-using-env.rs" ;
195
+ let out = rust_script ! ( option, script_path) . unwrap ( ) ;
196
+ scan ! ( out. stdout_output( ) ;
197
+ ( "msg = undefined" ) => ( )
198
+ )
199
+ . unwrap ( ) ;
200
+
201
+ std:: env:: set_var ( "_RUST_SCRIPT_TEST_MESSAGE" , "hello" ) ;
202
+
203
+ let out = rust_script ! ( script_path) . unwrap ( ) ;
204
+ scan ! ( out. stdout_output( ) ;
205
+ ( "msg = undefined" ) => ( )
206
+ )
207
+ . unwrap ( ) ;
208
+
209
+ let out = rust_script ! ( option, script_path) . unwrap ( ) ;
210
+ scan ! ( out. stdout_output( ) ;
211
+ ( "msg = hello" ) => ( )
212
+ )
213
+ . unwrap ( ) ;
214
+ }
215
+ }
216
+
189
217
#[ test]
190
218
#[ ignore]
191
219
fn test_stable_toolchain ( ) {
You can’t perform that action at this time.
0 commit comments