@@ -55,10 +55,12 @@ impl WorkspaceMetadata {
5555 // Basic Package Access
5656 // ============================================================================
5757
58+ /// Get all workspace member packages
5859 pub fn list_crates ( & self ) -> Vec < & Package > {
5960 self . metadata . workspace_packages ( )
6061 }
6162
63+ /// Find a package by name in the workspace
6264 pub fn get_package ( & self , name : & str ) -> Option < & Package > {
6365 self
6466 . metadata
@@ -67,6 +69,7 @@ impl WorkspaceMetadata {
6769 . find ( |pkg| pkg. name == name)
6870 }
6971
72+ /// Get the workspace root directory path
7073 pub fn workspace_root ( & self ) -> & std:: path:: Path {
7174 self . metadata . workspace_root . as_std_path ( )
7275 }
@@ -202,19 +205,6 @@ mod tests {
202205 assert ! ( missing. is_none( ) , "Non-existent package should be None" ) ;
203206 }
204207
205- #[ test]
206- fn test_workspace_root ( ) {
207- let metadata = create_test_metadata ( ) ;
208- let root = metadata. workspace_root ( ) ;
209-
210- // Should return valid path
211- assert ! ( root. exists( ) , "Workspace root should exist" ) ;
212- assert ! ( root. is_dir( ) , "Workspace root should be directory" ) ;
213-
214- // Should contain Cargo.toml
215- assert ! ( root. join( "Cargo.toml" ) . exists( ) , "Should have Cargo.toml" ) ;
216- }
217-
218208 // ============================================================================
219209 // Tier 2: Feature & Target Analysis
220210 // ============================================================================
@@ -272,43 +262,10 @@ mod tests {
272262 assert ! ( empty_features. is_ok( ) , "Should load with empty features list" ) ;
273263 }
274264
275- #[ test]
276- fn test_metadata_json ( ) {
277- let metadata = create_test_metadata ( ) ;
278- let raw = metadata. metadata_json ( ) ;
279-
280- // Should have access to raw metadata
281- assert ! ( !raw. packages. is_empty( ) , "Raw metadata should have packages" ) ;
282- }
283-
284265 // ============================================================================
285266 // Feature Unification Tests
286267 // ============================================================================
287268
288- #[ test]
289- fn test_get_resolved_features_for_package ( ) {
290- let metadata = create_test_metadata ( ) ;
291-
292- // Test with a known external dependency (serde)
293- // We know cargo-rail depends on serde
294- if let Some ( features) = metadata. get_resolved_features_for_package ( "serde" ) {
295- // Resolved features should be a set
296- assert ! (
297- !features. is_empty( ) || features. is_empty( ) ,
298- "Features set should be valid"
299- ) ;
300-
301- // serde commonly has these features in resolved graph
302- // (may vary based on what other crates enable)
303- // Just verify we got a valid HashSet
304- let _features_vec: Vec < String > = features. into_iter ( ) . collect ( ) ;
305- } else {
306- // It's ok if serde doesn't have resolved features in test context
307- // (might not be in resolve graph if running with limited metadata)
308- println ! ( "Note: serde not found in resolved graph (test may need full metadata)" ) ;
309- }
310- }
311-
312269 #[ test]
313270 fn test_get_resolved_features_returns_none_for_workspace_members ( ) {
314271 let metadata = create_test_metadata ( ) ;
0 commit comments