File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,16 @@ impl InputAction {
339339
340340 let built_binary_path = platform:: binary_cache_path ( )
341341 . 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+ } ) ;
343352
344353 let manifest_path = self . manifest_path ( ) ;
345354
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() {
186186 . unwrap ( )
187187}
188188
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+
189217#[ test]
190218#[ ignore]
191219fn test_stable_toolchain ( ) {
You can’t perform that action at this time.
0 commit comments