@@ -645,7 +645,7 @@ struct CargoTarget {
645
645
src_path : String ,
646
646
}
647
647
648
- #[ derive( PartialEq ) ]
648
+ #[ derive( Debug , PartialEq ) ]
649
649
enum TargetKind {
650
650
Bin ,
651
651
Example ,
@@ -1118,14 +1118,28 @@ mod tests {
1118
1118
(
1119
1119
r#"{"packages":[{"id":"path+file:///path/to/zed/crates/zed#0.131.0","targets":[{"name":"zed","kind":["bin"],"src_path":"/path/to/zed/src/main.rs"}]}]}"# ,
1120
1120
"/path/to/zed/src/main.rs" ,
1121
- Some ( ( "path+file:///path/to/zed/crates/zed#0.131.0" , "zed" ) ) ,
1121
+ Some ( (
1122
+ "path+file:///path/to/zed/crates/zed#0.131.0" ,
1123
+ "zed" ,
1124
+ TargetKind :: Bin ,
1125
+ ) ) ,
1122
1126
) ,
1123
1127
(
1124
1128
r#"{"packages":[{"id":"path+file:///path/to/custom-package#[email protected] ","targets":[{"name":"my-custom-bin","kind":["bin"],"src_path":"/path/to/custom-package/src/main.rs"}]}]}"# ,
1125
1129
"/path/to/custom-package/src/main.rs" ,
1126
1130
Some ( (
1127
1131
"path+file:///path/to/custom-package#[email protected] " ,
1128
1132
"my-custom-bin" ,
1133
+ TargetKind :: Bin ,
1134
+ ) ) ,
1135
+ ) ,
1136
+ (
1137
+ r#"{"packages":[{"id":"path+file:///path/to/custom-package#[email protected] ","targets":[{"name":"my-custom-bin","kind":["example"],"src_path":"/path/to/custom-package/src/main.rs"}]}]}"# ,
1138
+ "/path/to/custom-package/src/main.rs" ,
1139
+ Some ( (
1140
+ "path+file:///path/to/custom-package#[email protected] " ,
1141
+ "my-custom-bin" ,
1142
+ TargetKind :: Example ,
1129
1143
) ) ,
1130
1144
) ,
1131
1145
(
@@ -1140,7 +1154,7 @@ mod tests {
1140
1154
1141
1155
assert_eq ! (
1142
1156
retrieve_package_id_and_bin_name_from_metadata( metadata, absolute_path) ,
1143
- expected. map( |( pkgid, bin ) | ( pkgid. to_owned( ) , bin. to_owned( ) ) )
1157
+ expected. map( |( pkgid, name , kind ) | ( pkgid. to_owned( ) , bin. to_owned( ) , kind ) )
1144
1158
) ;
1145
1159
}
1146
1160
}
0 commit comments