MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_result_max_depth_tracked

Function test_result_max_depth_tracked

atomic-core/src/output/repo/tree.rs:1346–1357  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1344
1345 #[test]
1346 fn test_result_max_depth_tracked() {
1347 let mut result = TreeCollectResult::new();
1348 result.add_file(TreeItem::file("a.rs", Inode::ROOT, Position::ROOT));
1349 assert_eq!(result.max_depth_reached, 1);
1350
1351 result.add_file(TreeItem::file("a/b/c.rs", Inode::ROOT, Position::ROOT));
1352 assert_eq!(result.max_depth_reached, 3);
1353
1354 // Adding shallower item shouldn't decrease max depth
1355 result.add_file(TreeItem::file("x.rs", Inode::ROOT, Position::ROOT));
1356 assert_eq!(result.max_depth_reached, 3);
1357 }
1358
1359 #[test]
1360 fn test_result_clone() {

Callers

nothing calls this directly

Calls 1

add_fileMethod · 0.45

Tested by

no test coverage detected