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:1687–1707  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1685 #[test]
1686 #[serial]
1687 fn test_diff_patience_algorithm() {
1688 let _guard = DirGuard::new();
1689
1690 let temp_dir = tempfile::tempdir().unwrap();
1691 let repo_path = temp_dir.path();
1692
1693 // Initialize and add a file
1694 {
1695 let repo = Repository::init(repo_path).unwrap();
1696 std::fs::write(repo_path.join("test.txt"), "Original content\n").unwrap();
1697 repo.add("test.txt", Default::default()).unwrap();
1698 }
1699
1700 std::env::set_current_dir(repo_path).unwrap();
1701
1702 // Use patience algorithm
1703 let diff = Diff::new().with_algorithm("patience");
1704 let result = diff.run();
1705
1706 assert!(result.is_ok());
1707 }
1708
1709 #[test]
1710 #[serial]

Callers

nothing calls this directly

Calls 6

writeFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45
addMethod · 0.45
with_algorithmMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected