File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -813,6 +813,31 @@ Hello world!
813813 . run ( ) ;
814814}
815815
816+ #[ cargo_test]
817+ fn test_no_autolib ( ) {
818+ let script = r#"#!/usr/bin/env cargo
819+
820+ fn main() {
821+ println!("Hello world!");
822+ }"# ;
823+ let p = cargo_test_support:: project ( )
824+ . file ( "script.rs" , script)
825+ . file ( "src/lib.rs" , r#"compile_error!{"must not be built"}"# )
826+ . build ( ) ;
827+
828+ p. cargo ( "-Zscript -v script.rs --help" )
829+ . masquerade_as_nightly_cargo ( & [ "script" ] )
830+ . with_status ( 101 )
831+ . with_stdout_data ( str![ "" ] )
832+ . with_stderr_data ( str![ [ r#"
833+ ...
834+ [..]compile_error!{"must not be built"}[..]
835+ ...
836+
837+ "# ] ] )
838+ . run ( ) ;
839+ }
840+
816841#[ cargo_test]
817842fn implicit_target_dir ( ) {
818843 let script = ECHO_SCRIPT ;
You can’t perform that action at this time.
0 commit comments