@@ -600,14 +600,14 @@ fn script_like_dir() {
600
600
. with_status ( 101 )
601
601
. with_stderr (
602
602
"\
603
- error: manifest path `foo.rs` is a directory but expected a file
603
+ [ERROR] manifest path `foo.rs` is a directory but expected a file
604
604
" ,
605
605
)
606
606
. run ( ) ;
607
607
}
608
608
609
609
#[ cargo_test]
610
- fn missing_script_rs ( ) {
610
+ fn non_existent_rs ( ) {
611
611
let p = cargo_test_support:: project ( ) . build ( ) ;
612
612
613
613
p. cargo ( "-Zscript -v foo.rs" )
@@ -621,6 +621,90 @@ fn missing_script_rs() {
621
621
. run ( ) ;
622
622
}
623
623
624
+ #[ cargo_test]
625
+ fn non_existent_rs_stable ( ) {
626
+ let p = cargo_test_support:: project ( ) . build ( ) ;
627
+
628
+ p. cargo ( "-v foo.rs" )
629
+ . masquerade_as_nightly_cargo ( & [ "script" ] )
630
+ . with_status ( 101 )
631
+ . with_stdout ( "" )
632
+ . with_stderr (
633
+ "\
634
+ [ERROR] running `foo.rs` requires `-Zscript`
635
+ " ,
636
+ )
637
+ . run ( ) ;
638
+ }
639
+
640
+ #[ cargo_test]
641
+ fn did_you_mean_file ( ) {
642
+ let p = cargo_test_support:: project ( )
643
+ . file ( "food.rs" , ECHO_SCRIPT )
644
+ . build ( ) ;
645
+
646
+ p. cargo ( "-Zscript -v foo.rs" )
647
+ . masquerade_as_nightly_cargo ( & [ "script" ] )
648
+ . with_status ( 101 )
649
+ . with_stdout ( "" )
650
+ . with_stderr (
651
+ "\
652
+ [ERROR] manifest path `foo.rs` does not exist
653
+ " ,
654
+ )
655
+ . run ( ) ;
656
+ }
657
+
658
+ #[ cargo_test]
659
+ fn did_you_mean_file_stable ( ) {
660
+ let p = cargo_test_support:: project ( )
661
+ . file ( "food.rs" , ECHO_SCRIPT )
662
+ . build ( ) ;
663
+
664
+ p. cargo ( "-v foo.rs" )
665
+ . masquerade_as_nightly_cargo ( & [ "script" ] )
666
+ . with_status ( 101 )
667
+ . with_stdout ( "" )
668
+ . with_stderr (
669
+ "\
670
+ [ERROR] running `foo.rs` requires `-Zscript`
671
+ " ,
672
+ )
673
+ . run ( ) ;
674
+ }
675
+
676
+ #[ cargo_test]
677
+ fn did_you_mean_command ( ) {
678
+ let p = cargo_test_support:: project ( ) . build ( ) ;
679
+
680
+ p. cargo ( "-Zscript -v build--manifest-path=./Cargo.toml" )
681
+ . masquerade_as_nightly_cargo ( & [ "script" ] )
682
+ . with_status ( 101 )
683
+ . with_stdout ( "" )
684
+ . with_stderr (
685
+ "\
686
+ [ERROR] manifest path `build--manifest-path=./Cargo.toml` does not exist
687
+ " ,
688
+ )
689
+ . run ( ) ;
690
+ }
691
+
692
+ #[ cargo_test]
693
+ fn did_you_mean_command_stable ( ) {
694
+ let p = cargo_test_support:: project ( ) . build ( ) ;
695
+
696
+ p. cargo ( "-v build--manifest-path=./Cargo.toml" )
697
+ . masquerade_as_nightly_cargo ( & [ "script" ] )
698
+ . with_status ( 101 )
699
+ . with_stdout ( "" )
700
+ . with_stderr (
701
+ "\
702
+ [ERROR] running `build--manifest-path=./Cargo.toml` requires `-Zscript`
703
+ " ,
704
+ )
705
+ . run ( ) ;
706
+ }
707
+
624
708
#[ cargo_test]
625
709
fn test_name_same_as_dependency ( ) {
626
710
Package :: new ( "script" , "1.0.0" ) . publish ( ) ;
0 commit comments