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