()
| 659 | |
| 660 | #[test] |
| 661 | fn test_move_to_existing_fails() { |
| 662 | use atomic_core::pristine::Pristine; |
| 663 | use tempfile::TempDir; |
| 664 | |
| 665 | let temp_dir = TempDir::new().unwrap(); |
| 666 | let db_path = temp_dir.path().join("pristine.redb"); |
| 667 | |
| 668 | let pristine = Pristine::open(&db_path).unwrap(); |
| 669 | |
| 670 | // Add two files |
| 671 | { |
| 672 | let mut txn = pristine.write_txn().unwrap(); |
| 673 | add_to_tree(&mut txn, "file1.txt", false).unwrap(); |
| 674 | add_to_tree(&mut txn, "file2.txt", false).unwrap(); |
| 675 | txn.commit().unwrap(); |
| 676 | } |
| 677 | |
| 678 | // Try to move file1 to file2 (should fail) |
| 679 | { |
| 680 | let mut txn = pristine.write_txn().unwrap(); |
| 681 | let result = move_tracked(&mut txn, "file1.txt", "file2.txt"); |
| 682 | assert!(result.is_err()); |
| 683 | assert!(matches!( |
| 684 | result.unwrap_err(), |
| 685 | TrackingError::DestinationExists { .. } |
| 686 | )); |
| 687 | } |
| 688 | } |
| 689 | |
| 690 | #[test] |
| 691 | fn test_move_nonexistent_fails() { |
nothing calls this directly
no test coverage detected