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

Function test_add_and_check_tracked

atomic-repository/src/tracking/tests.rs:461–484  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

459
460#[test]
461fn test_add_and_check_tracked() {
462 use atomic_core::pristine::Pristine;
463 use tempfile::TempDir;
464
465 let temp_dir = TempDir::new().unwrap();
466 let db_path = temp_dir.path().join("pristine.redb");
467
468 let pristine = Pristine::open(&db_path).unwrap();
469
470 // Add a file to tracking
471 {
472 let mut txn = pristine.write_txn().unwrap();
473 let inode = add_to_tree(&mut txn, "src/main.rs", false).unwrap();
474 assert!(inode.get() > 0);
475 txn.commit().unwrap();
476 }
477
478 // Check it's tracked
479 {
480 let txn = pristine.read_txn().unwrap();
481 assert!(is_tracked(&txn, "src/main.rs").unwrap());
482 assert!(!is_tracked(&txn, "nonexistent.rs").unwrap());
483 }
484}
485
486#[test]
487fn test_add_and_get_inode() {

Callers

nothing calls this directly

Calls 6

add_to_treeFunction · 0.85
write_txnMethod · 0.80
commitMethod · 0.80
read_txnMethod · 0.80
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected