@@ -1007,3 +1007,121 @@ fn all_features_flag_enables_all_features() {
1007
1007
assert_that ( p. cargo_process ( "build" ) . arg ( "--all-features" ) ,
1008
1008
execs ( ) . with_status ( 0 ) ) ;
1009
1009
}
1010
+
1011
+ #[ test]
1012
+ fn many_cli_features_comma_delimited ( ) {
1013
+ let p = project ( "foo" )
1014
+ . file ( "Cargo.toml" , r#"
1015
+ [project]
1016
+ name = "foo"
1017
+ version = "0.0.1"
1018
+ authors = []
1019
+
1020
+ [dependencies.bar]
1021
+ path = "bar"
1022
+ optional = true
1023
+
1024
+ [dependencies.baz]
1025
+ path = "baz"
1026
+ optional = true
1027
+ "# )
1028
+ . file ( "src/main.rs" , r#"
1029
+ extern crate bar;
1030
+ extern crate baz;
1031
+ fn main() {}
1032
+ "# )
1033
+ . file ( "bar/Cargo.toml" , r#"
1034
+ [package]
1035
+ name = "bar"
1036
+ version = "0.0.1"
1037
+ authors = []
1038
+ "# )
1039
+ . file ( "bar/src/lib.rs" , "pub fn bar() {}" )
1040
+ . file ( "baz/Cargo.toml" , r#"
1041
+ [package]
1042
+ name = "baz"
1043
+ version = "0.0.1"
1044
+ authors = []
1045
+ "# )
1046
+ . file ( "baz/src/lib.rs" , "pub fn baz() {}" ) ;
1047
+
1048
+ assert_that ( p. cargo_process ( "build" ) . arg ( "--features" ) . arg ( "bar,baz" ) ,
1049
+ execs ( ) . with_status ( 0 ) . with_stderr ( format ! ( "\
1050
+ [COMPILING] ba[..] v0.0.1 ({dir}/ba[..])
1051
+ [COMPILING] ba[..] v0.0.1 ({dir}/ba[..])
1052
+ [COMPILING] foo v0.0.1 ({dir})
1053
+ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
1054
+ " , dir = p. url( ) ) ) ) ;
1055
+ }
1056
+
1057
+ #[ test]
1058
+ fn many_cli_features_comma_and_space_delimited ( ) {
1059
+ let p = project ( "foo" )
1060
+ . file ( "Cargo.toml" , r#"
1061
+ [project]
1062
+ name = "foo"
1063
+ version = "0.0.1"
1064
+ authors = []
1065
+
1066
+ [dependencies.bar]
1067
+ path = "bar"
1068
+ optional = true
1069
+
1070
+ [dependencies.baz]
1071
+ path = "baz"
1072
+ optional = true
1073
+
1074
+ [dependencies.bam]
1075
+ path = "bam"
1076
+ optional = true
1077
+
1078
+ [dependencies.bap]
1079
+ path = "bap"
1080
+ optional = true
1081
+ "# )
1082
+ . file ( "src/main.rs" , r#"
1083
+ extern crate bar;
1084
+ extern crate baz;
1085
+ extern crate bam;
1086
+ extern crate bap;
1087
+ fn main() {}
1088
+ "# )
1089
+ . file ( "bar/Cargo.toml" , r#"
1090
+ [package]
1091
+ name = "bar"
1092
+ version = "0.0.1"
1093
+ authors = []
1094
+ "# )
1095
+ . file ( "bar/src/lib.rs" , "pub fn bar() {}" )
1096
+ . file ( "baz/Cargo.toml" , r#"
1097
+ [package]
1098
+ name = "baz"
1099
+ version = "0.0.1"
1100
+ authors = []
1101
+ "# )
1102
+ . file ( "baz/src/lib.rs" , "pub fn baz() {}" )
1103
+ . file ( "bam/Cargo.toml" , r#"
1104
+ [package]
1105
+ name = "bam"
1106
+ version = "0.0.1"
1107
+ authors = []
1108
+ "# )
1109
+ . file ( "bam/src/lib.rs" , "pub fn bam() {}" )
1110
+ . file ( "bap/Cargo.toml" , r#"
1111
+ [package]
1112
+ name = "bap"
1113
+ version = "0.0.1"
1114
+ authors = []
1115
+ "# )
1116
+ . file ( "bap/src/lib.rs" , "pub fn bap() {}" ) ;
1117
+
1118
+ assert_that ( p. cargo_process ( "build" ) . arg ( "--features" ) . arg ( "bar,baz bam bap" ) ,
1119
+ execs ( ) . with_status ( 0 ) . with_stderr ( format ! ( "\
1120
+ [COMPILING] ba[..] v0.0.1 ({dir}/ba[..])
1121
+ [COMPILING] ba[..] v0.0.1 ({dir}/ba[..])
1122
+ [COMPILING] ba[..] v0.0.1 ({dir}/ba[..])
1123
+ [COMPILING] ba[..] v0.0.1 ({dir}/ba[..])
1124
+ [COMPILING] foo v0.0.1 ({dir})
1125
+ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
1126
+ " , dir = p. url( ) ) ) ) ;
1127
+ }
0 commit comments