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

Function test_diff_patience_algorithm

atomic-cli/src/commands/diff/tests.rs:1724–1746  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1722 #[test]
1723 #[file_serial]
1724 fn test_diff_patience_algorithm() {
1725 let _guard = DirGuard::new();
1726
1727 let temp_dir = tempfile::tempdir().unwrap();
1728 let repo_path = temp_dir.path();
1729
1730 // Initialize and add a file
1731 {
1732 let repo = Repository::init(repo_path).unwrap();
1733 std::fs::write(repo_path.join("test.txt"), "Original content\n").unwrap();
1734 let working_copy = repo.require_working_copy_id().unwrap();
1735 repo.add(working_copy, "test.txt", Default::default())
1736 .unwrap();
1737 }
1738
1739 std::env::set_current_dir(repo_path).unwrap();
1740
1741 // Use patience algorithm
1742 let diff = Diff::new().with_algorithm("patience");
1743 let result = diff.run();
1744
1745 assert!(result.is_ok());
1746 }
1747
1748 #[test]
1749 #[file_serial]

Callers

nothing calls this directly

Calls 8

initFunction · 0.50
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
addMethod · 0.45
with_algorithmMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected