@@ -47,7 +47,8 @@ fn cargo_metadata_simple() {
47
47
],
48
48
"features": {},
49
49
"manifest_path": "[..]Cargo.toml",
50
- "metadata": null
50
+ "metadata": null,
51
+ "publish": null
51
52
}
52
53
],
53
54
"workspace_members": ["foo 0.5.0 (path+file:[..]foo)"],
@@ -138,7 +139,8 @@ crate-type = ["lib", "staticlib"]
138
139
],
139
140
"features": {},
140
141
"manifest_path": "[..]Cargo.toml",
141
- "metadata": null
142
+ "metadata": null,
143
+ "publish": null
142
144
}
143
145
],
144
146
"workspace_members": ["foo 0.5.0 (path+file:[..]foo)"],
@@ -223,7 +225,8 @@ optional_feat = []
223
225
"optional_feat": []
224
226
},
225
227
"manifest_path": "[..]Cargo.toml",
226
- "metadata": null
228
+ "metadata": null,
229
+ "publish": null
227
230
}
228
231
],
229
232
"workspace_members": ["foo 0.5.0 (path+file:[..]foo)"],
@@ -296,6 +299,7 @@ fn cargo_metadata_with_deps_and_version() {
296
299
"links": null,
297
300
"manifest_path": "[..]Cargo.toml",
298
301
"metadata": null,
302
+ "publish": null,
299
303
"name": "baz",
300
304
"readme": null,
301
305
"repository": null,
@@ -355,6 +359,7 @@ fn cargo_metadata_with_deps_and_version() {
355
359
"links": null,
356
360
"manifest_path": "[..]Cargo.toml",
357
361
"metadata": null,
362
+ "publish": null,
358
363
"name": "foo",
359
364
"readme": null,
360
365
"repository": null,
@@ -389,6 +394,7 @@ fn cargo_metadata_with_deps_and_version() {
389
394
"links": null,
390
395
"manifest_path": "[..]Cargo.toml",
391
396
"metadata": null,
397
+ "publish": null,
392
398
"name": "foobar",
393
399
"readme": null,
394
400
"repository": null,
@@ -436,6 +442,7 @@ fn cargo_metadata_with_deps_and_version() {
436
442
"links": null,
437
443
"manifest_path": "[..]Cargo.toml",
438
444
"metadata": null,
445
+ "publish": null,
439
446
"name": "bar",
440
447
"readme": null,
441
448
"repository": null,
@@ -575,7 +582,8 @@ name = "ex"
575
582
],
576
583
"features": {},
577
584
"manifest_path": "[..]Cargo.toml",
578
- "metadata": null
585
+ "metadata": null,
586
+ "publish": null
579
587
}
580
588
],
581
589
"workspace_members": [
@@ -660,7 +668,8 @@ crate-type = ["rlib", "dylib"]
660
668
],
661
669
"features": {},
662
670
"manifest_path": "[..]Cargo.toml",
663
- "metadata": null
671
+ "metadata": null,
672
+ "publish": null
664
673
}
665
674
],
666
675
"workspace_members": [
@@ -736,7 +745,8 @@ fn workspace_metadata() {
736
745
],
737
746
"features": {},
738
747
"manifest_path": "[..]bar/Cargo.toml",
739
- "metadata": null
748
+ "metadata": null,
749
+ "publish": null
740
750
},
741
751
{
742
752
"authors": [
@@ -768,7 +778,8 @@ fn workspace_metadata() {
768
778
],
769
779
"features": {},
770
780
"manifest_path": "[..]baz/Cargo.toml",
771
- "metadata": null
781
+ "metadata": null,
782
+ "publish": null
772
783
}
773
784
],
774
785
"workspace_members": ["baz 0.5.0 (path+file:[..]baz)", "bar 0.5.0 (path+file:[..]bar)"],
@@ -848,7 +859,8 @@ fn workspace_metadata_no_deps() {
848
859
],
849
860
"features": {},
850
861
"manifest_path": "[..]bar/Cargo.toml",
851
- "metadata": null
862
+ "metadata": null,
863
+ "publish": null
852
864
},
853
865
{
854
866
"authors": [
@@ -880,7 +892,8 @@ fn workspace_metadata_no_deps() {
880
892
],
881
893
"features": {},
882
894
"manifest_path": "[..]baz/Cargo.toml",
883
- "metadata": null
895
+ "metadata": null,
896
+ "publish": null
884
897
}
885
898
],
886
899
"workspace_members": ["baz 0.5.0 (path+file:[..]baz)", "bar 0.5.0 (path+file:[..]bar)"],
@@ -938,6 +951,7 @@ const MANIFEST_OUTPUT: &str = r#"
938
951
"features":{},
939
952
"manifest_path":"[..]Cargo.toml",
940
953
"metadata": null,
954
+ "publish": null,
941
955
"readme": null,
942
956
"repository": null
943
957
}],
@@ -1121,7 +1135,75 @@ fn package_metadata() {
1121
1135
"bar": {
1122
1136
"baz": "quux"
1123
1137
}
1124
- }
1138
+ },
1139
+ "publish": null
1140
+ }
1141
+ ],
1142
+ "workspace_members": ["foo[..]"],
1143
+ "resolve": null,
1144
+ "target_directory": "[..]foo/target",
1145
+ "version": 1,
1146
+ "workspace_root": "[..]/foo"
1147
+ }"# ,
1148
+ )
1149
+ . run ( ) ;
1150
+ }
1151
+
1152
+ #[ cargo_test]
1153
+ fn package_publish ( ) {
1154
+ let p = project ( )
1155
+ . file (
1156
+ "Cargo.toml" ,
1157
+ r#"
1158
+ [package]
1159
+ name = "foo"
1160
+ version = "0.1.0"
1161
+ authors = ["wycats@example.com"]
1162
+ categories = ["database"]
1163
+ keywords = ["database"]
1164
+ readme = "README.md"
1165
+ repository = "https://github.com/rust-lang/cargo"
1166
+ publish = ["my-registry"]
1167
+ "# ,
1168
+ )
1169
+ . file ( "src/lib.rs" , "" )
1170
+ . build ( ) ;
1171
+
1172
+ p. cargo ( "metadata --no-deps" )
1173
+ . with_json (
1174
+ r#"
1175
+ {
1176
+ "packages": [
1177
+ {
1178
+ "authors": ["wycats@example.com"],
1179
+ "categories": ["database"],
1180
+ "name": "foo",
1181
+ "readme": "README.md",
1182
+ "repository": "https://github.com/rust-lang/cargo",
1183
+ "version": "0.1.0",
1184
+ "id": "foo[..]",
1185
+ "keywords": ["database"],
1186
+ "source": null,
1187
+ "dependencies": [],
1188
+ "edition": "2015",
1189
+ "license": null,
1190
+ "license_file": null,
1191
+ "links": null,
1192
+ "description": null,
1193
+ "targets": [
1194
+ {
1195
+ "kind": [ "lib" ],
1196
+ "crate_types": [ "lib" ],
1197
+ "doctest": true,
1198
+ "edition": "2015",
1199
+ "name": "foo",
1200
+ "src_path": "[..]foo/src/lib.rs"
1201
+ }
1202
+ ],
1203
+ "features": {},
1204
+ "manifest_path": "[..]foo/Cargo.toml",
1205
+ "metadata": null,
1206
+ "publish": ["my-registry"]
1125
1207
}
1126
1208
],
1127
1209
"workspace_members": ["foo[..]"],
@@ -1175,6 +1257,7 @@ fn cargo_metadata_path_to_cargo_toml_project() {
1175
1257
"links": null,
1176
1258
"manifest_path": "[..]Cargo.toml",
1177
1259
"metadata": null,
1260
+ "publish": null,
1178
1261
"name": "bar",
1179
1262
"readme": null,
1180
1263
"repository": null,
@@ -1255,6 +1338,7 @@ fn package_edition_2018() {
1255
1338
"links": null,
1256
1339
"manifest_path": "[..]Cargo.toml",
1257
1340
"metadata": null,
1341
+ "publish": null,
1258
1342
"name": "foo",
1259
1343
"readme": null,
1260
1344
"repository": null,
@@ -1339,6 +1423,7 @@ fn target_edition_2018() {
1339
1423
"links": null,
1340
1424
"manifest_path": "[..]Cargo.toml",
1341
1425
"metadata": null,
1426
+ "publish": null,
1342
1427
"name": "foo",
1343
1428
"readme": null,
1344
1429
"repository": null,
@@ -1461,6 +1546,7 @@ fn rename_dependency() {
1461
1546
"links": null,
1462
1547
"manifest_path": "[..]",
1463
1548
"metadata": null,
1549
+ "publish": null,
1464
1550
"name": "foo",
1465
1551
"readme": null,
1466
1552
"repository": null,
@@ -1495,6 +1581,7 @@ fn rename_dependency() {
1495
1581
"links": null,
1496
1582
"manifest_path": "[..]",
1497
1583
"metadata": null,
1584
+ "publish": null,
1498
1585
"name": "bar",
1499
1586
"readme": null,
1500
1587
"repository": null,
@@ -1529,6 +1616,7 @@ fn rename_dependency() {
1529
1616
"links": null,
1530
1617
"manifest_path": "[..]",
1531
1618
"metadata": null,
1619
+ "publish": null,
1532
1620
"name": "bar",
1533
1621
"readme": null,
1534
1622
"repository": null,
@@ -1631,6 +1719,7 @@ fn metadata_links() {
1631
1719
"links": "a",
1632
1720
"manifest_path": "[..]/foo/Cargo.toml",
1633
1721
"metadata": null,
1722
+ "publish": null,
1634
1723
"name": "foo",
1635
1724
"readme": null,
1636
1725
"repository": null,
0 commit comments