MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / test_get_independent_headers

Function test_get_independent_headers

src/analysis/header.rs:416–440  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

414
415#[test]
416fn test_get_independent_headers() {
417 // Create test data
418 let mut root1 = TreeNode::new("header1.h".to_string());
419 let mut child1 = TreeNode::new("child1.h".to_string());
420 let child2 = TreeNode::new("child2.h".to_string());
421 child1.add_child(child2);
422 root1.add_child(child1);
423
424 let mut root2 = TreeNode::new("header2.h".to_string());
425 let child3 = TreeNode::new("child3.h".to_string());
426 root2.add_child(child3);
427
428 let trees = vec![root1, root2];
429
430 // Test the function
431 let result = get_independent_headers(&trees).unwrap();
432
433 // Verify results - should return root nodes since they are not included by others
434 assert_eq!(result.len(), 2);
435 assert!(result.contains(&"header1.h"));
436 assert!(result.contains(&"header2.h"));
437 assert!(!result.contains(&"child1.h"));
438 assert!(!result.contains(&"child2.h"));
439 assert!(!result.contains(&"child3.h"));
440}
441
442#[test]
443fn test_get_independent_headers_complex() {

Callers

nothing calls this directly

Calls 2

get_independent_headersFunction · 0.85
add_childMethod · 0.80

Tested by

no test coverage detected