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:1336–1347  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1334
1335 #[test]
1336 fn test_result_max_depth_tracked() {
1337 let mut result = TreeCollectResult::new();
1338 result.add_file(TreeItem::file("a.rs", Inode::ROOT, Position::ROOT));
1339 assert_eq!(result.max_depth_reached, 1);
1340
1341 result.add_file(TreeItem::file("a/b/c.rs", Inode::ROOT, Position::ROOT));
1342 assert_eq!(result.max_depth_reached, 3);
1343
1344 // Adding shallower item shouldn't decrease max depth
1345 result.add_file(TreeItem::file("x.rs", Inode::ROOT, Position::ROOT));
1346 assert_eq!(result.max_depth_reached, 3);
1347 }
1348
1349 #[test]
1350 fn test_result_clone() {

Callers

nothing calls this directly

Calls 1

add_fileMethod · 0.45

Tested by

no test coverage detected