File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -845,6 +845,55 @@ Caused by:
845
845
. run ( ) ;
846
846
}
847
847
848
+ #[ cargo_test]
849
+ /// Tests if a broken but excluded symlink is ignored.
850
+ /// See issue rust-lang/cargo#10917
851
+ ///
852
+ /// This test requires you to be able to make symlinks.
853
+ /// For windows, this may require you to enable developer mode.
854
+ fn broken_but_excluded_symlink ( ) {
855
+ #[ cfg( unix) ]
856
+ use std:: os:: unix:: fs:: symlink;
857
+ #[ cfg( windows) ]
858
+ use std:: os:: windows:: fs:: symlink_dir as symlink;
859
+
860
+ if !symlink_supported ( ) {
861
+ return ;
862
+ }
863
+
864
+ let p = project ( )
865
+ . file (
866
+ "Cargo.toml" ,
867
+ r#"
868
+ [project]
869
+ name = "foo"
870
+ version = "0.0.1"
871
+ authors = []
872
+ license = "MIT"
873
+ description = 'foo'
874
+ documentation = 'foo'
875
+ homepage = 'foo'
876
+ repository = 'foo'
877
+ exclude = ["src/foo.rs"]
878
+ "# ,
879
+ )
880
+ . file ( "src/main.rs" , r#"fn main() { println!("hello"); }"# )
881
+ . build ( ) ;
882
+ t ! ( symlink( "nowhere" , & p. root( ) . join( "src/foo.rs" ) ) ) ;
883
+
884
+ p. cargo ( "package -v --list" )
885
+ // `src/foo.rs` is excluded.
886
+ . with_stdout (
887
+ "\
888
+ Cargo.lock
889
+ Cargo.toml
890
+ Cargo.toml.orig
891
+ src/main.rs
892
+ " ,
893
+ )
894
+ . run ( ) ;
895
+ }
896
+
848
897
#[ cargo_test]
849
898
#[ cfg( not( windows) ) ] // https://github.com/libgit2/libgit2/issues/6250
850
899
/// Test that /dir and /dir/ matches symlinks to directories.
You can’t perform that action at this time.
0 commit comments