File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -3041,3 +3041,59 @@ src/main.rs
3041
3041
& [ ] ,
3042
3042
) ;
3043
3043
}
3044
+ #[ cargo_test]
3045
+ #[ cfg( windows) ] // windows is the platform that is most consistently configured for case insensitive filesystems
3046
+ fn no_manifest_found ( ) {
3047
+ let p = project ( )
3048
+ . file ( "src/main.rs" , r#"fn main() { println!("hello"); }"# )
3049
+ . file ( "src/bar.txt" , "" ) // should be ignored when packaging
3050
+ . build ( ) ;
3051
+ // Workaround `project()` making a `Cargo.toml` on our behalf
3052
+ std:: fs:: remove_file ( p. root ( ) . join ( "Cargo.toml" ) ) . unwrap ( ) ;
3053
+ std:: fs:: write (
3054
+ p. root ( ) . join ( "CARGO.TOML" ) ,
3055
+ r#"
3056
+ [package]
3057
+ name = "foo"
3058
+ version = "0.0.1"
3059
+ authors = []
3060
+ exclude = ["*.txt"]
3061
+ license = "MIT"
3062
+ description = "foo"
3063
+ "# ,
3064
+ )
3065
+ . unwrap ( ) ;
3066
+
3067
+ p. cargo ( "package" )
3068
+ . with_stderr (
3069
+ "\
3070
+ [WARNING] manifest has no documentation[..]
3071
+ See [..]
3072
+ [PACKAGING] foo v0.0.1 ([CWD])
3073
+ [VERIFYING] foo v0.0.1 ([CWD])
3074
+ [COMPILING] foo v0.0.1 ([CWD][..])
3075
+ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
3076
+ [PACKAGED] 3 files, [..] ([..] compressed)
3077
+ " ,
3078
+ )
3079
+ . run ( ) ;
3080
+ assert ! ( p. root( ) . join( "target/package/foo-0.0.1.crate" ) . is_file( ) ) ;
3081
+ p. cargo ( "package -l" )
3082
+ . with_stdout (
3083
+ "\
3084
+ CARGO.TOML
3085
+ Cargo.lock
3086
+ src/main.rs
3087
+ " ,
3088
+ )
3089
+ . run ( ) ;
3090
+ p. cargo ( "package" ) . with_stdout ( "" ) . run ( ) ;
3091
+
3092
+ let f = File :: open ( & p. root ( ) . join ( "target/package/foo-0.0.1.crate" ) ) . unwrap ( ) ;
3093
+ validate_crate_contents (
3094
+ f,
3095
+ "foo-0.0.1.crate" ,
3096
+ & [ "CARGO.TOML" , "Cargo.lock" , "src/main.rs" ] ,
3097
+ & [ ] ,
3098
+ ) ;
3099
+ }
You can’t perform that action at this time.
0 commit comments