File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -508,3 +508,32 @@ fn main() {
508
508
)
509
509
. run ( ) ;
510
510
}
511
+
512
+ #[ cargo_test]
513
+ fn test_no_autobins ( ) {
514
+ let script = r#"#!/usr/bin/env cargo
515
+
516
+ fn main() {
517
+ println!("Hello world!");
518
+ }"# ;
519
+ let p = cargo_test_support:: project ( )
520
+ . file ( "script.rs" , script)
521
+ . file ( "src/bin/not-script/main.rs" , "fn main() {}" )
522
+ . build ( ) ;
523
+
524
+ p. cargo ( "-Zscript script.rs --help" )
525
+ . masquerade_as_nightly_cargo ( & [ "script" ] )
526
+ . with_stdout (
527
+ r#"Hello world!
528
+ "# ,
529
+ )
530
+ . with_stderr (
531
+ "\
532
+ [WARNING] `package.edition` is unspecifiead, defaulting to `2021`
533
+ [COMPILING] script v0.0.0 ([ROOT]/home/.cargo/eval/target/eval/[..]/script)
534
+ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
535
+ [RUNNING] `[ROOT]/home/.cargo/eval/target/eval/[..]/script/target/debug/script[EXE] --help`
536
+ " ,
537
+ )
538
+ . run ( ) ;
539
+ }
You can’t perform that action at this time.
0 commit comments