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

Function test_move_nonexistent_fails

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

Source from the content-addressed store, hash-verified

689
690#[test]
691fn test_move_nonexistent_fails() {
692 use atomic_core::pristine::Pristine;
693 use tempfile::TempDir;
694
695 let temp_dir = TempDir::new().unwrap();
696 let db_path = temp_dir.path().join("pristine.redb");
697
698 let pristine = Pristine::open(&db_path).unwrap();
699
700 // Try to move nonexistent file
701 {
702 let mut txn = pristine.write_txn().unwrap();
703 let result = move_tracked(&mut txn, "nonexistent.txt", "new.txt");
704 assert!(result.is_err());
705 assert!(matches!(
706 result.unwrap_err(),
707 TrackingError::NotTracked { .. }
708 ));
709 }
710}
711
712/// A graph-bound inode belongs to the change that bound it, so untracking it by
713/// editing the derived tables must be refused rather than wipe the binding.

Callers

nothing calls this directly

Calls 5

openFunction · 0.85
move_trackedFunction · 0.85
write_txnMethod · 0.80
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected