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

Function test_move_nonexistent_fails

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

Source from the content-addressed store, hash-verified

686
687#[test]
688fn test_move_nonexistent_fails() {
689 use atomic_core::pristine::Pristine;
690 use tempfile::TempDir;
691
692 let temp_dir = TempDir::new().unwrap();
693 let db_path = temp_dir.path().join("pristine.redb");
694
695 let pristine = Pristine::open(&db_path).unwrap();
696
697 // Try to move nonexistent file
698 {
699 let mut txn = pristine.write_txn().unwrap();
700 let result = move_tracked(&mut txn, "nonexistent.txt", "new.txt");
701 assert!(result.is_err());
702 assert!(matches!(
703 result.unwrap_err(),
704 TrackingError::NotTracked { .. }
705 ));
706 }
707}

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected