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

Source from the content-addressed store, hash-verified

1447 #[test]
1448 #[serial]
1449 fn test_diff_patience_algorithm() {
1450 let _guard = DirGuard::new();
1451
1452 let temp_dir = tempfile::tempdir().unwrap();
1453 let repo_path = temp_dir.path();
1454
1455 // Initialize and add a file
1456 {
1457 let repo = Repository::init(repo_path).unwrap();
1458 std::fs::write(repo_path.join("test.txt"), "Original content\n").unwrap();
1459 repo.add("test.txt", Default::default()).unwrap();
1460 }
1461
1462 std::env::set_current_dir(repo_path).unwrap();
1463
1464 // Use patience algorithm
1465 let diff = Diff::new().with_algorithm("patience");
1466 let result = diff.run();
1467
1468 assert!(result.is_ok());
1469 }
1470
1471 #[test]
1472 #[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