@@ -794,10 +794,10 @@ fn broken_symlink() {
794
794
. with_status ( 101 )
795
795
. with_stderr_contains (
796
796
"\
797
- error: failed to prepare local package for uploading
797
+ error: failed to determine list of files [..]/foo
798
798
799
799
Caused by:
800
- failed to open for archiving: ` [..]foo.rs`
800
+ IO error for operation on [..]/ foo/src/foo .rs: [..]
801
801
802
802
Caused by:
803
803
[..]
@@ -826,6 +826,28 @@ fn package_symlink_to_dir() {
826
826
. run ( ) ;
827
827
}
828
828
829
+ #[ cargo_test]
830
+ /// Tests if a symlink to ancestor causes filesystem loop error.
831
+ ///
832
+ /// This test requires you to be able to make symlinks.
833
+ /// For windows, this may require you to enable developer mode.
834
+ fn filesystem_loop ( ) {
835
+ if !symlink_supported ( ) {
836
+ return ;
837
+ }
838
+
839
+ project ( )
840
+ . file ( "src/main.rs" , r#"fn main() { println!("hello"); }"# )
841
+ . symlink_dir ( "a/b" , "a/b/c/d/foo" )
842
+ . build ( )
843
+ . cargo ( "package -v" )
844
+ . with_status ( 101 )
845
+ . with_stderr_contains (
846
+ " File system loop found: [..]/a/b/c/d/foo points to an ancestor [..]/a/b" ,
847
+ )
848
+ . run ( ) ;
849
+ }
850
+
829
851
#[ cargo_test]
830
852
fn do_not_package_if_repository_is_dirty ( ) {
831
853
let p = project ( ) . build ( ) ;
@@ -1798,7 +1820,8 @@ fn package_restricted_windows() {
1798
1820
. build ( ) ;
1799
1821
1800
1822
p. cargo ( "package" )
1801
- . with_stderr (
1823
+ // use unordered here because the order of the warning is different on each platform.
1824
+ . with_stderr_unordered (
1802
1825
"\
1803
1826
[WARNING] file src/aux/mod.rs is a reserved Windows filename, it will not work on Windows platforms
1804
1827
[WARNING] file src/con.rs is a reserved Windows filename, it will not work on Windows platforms
0 commit comments