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

Function test_diff_run_stat_format

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

Source from the content-addressed store, hash-verified

1397 #[test]
1398 #[file_serial]
1399 fn test_diff_run_stat_format() {
1400 let _guard = DirGuard::new();
1401
1402 let temp_dir = tempfile::tempdir().unwrap();
1403 let repo_path = temp_dir.path();
1404
1405 // Initialize repository and add a file
1406 {
1407 let repo = Repository::init(repo_path).unwrap();
1408 std::fs::write(repo_path.join("test.txt"), "Line 1\nLine 2\nLine 3\n").unwrap();
1409 let working_copy = repo.require_working_copy_id().unwrap();
1410 repo.add(working_copy, "test.txt", Default::default())
1411 .unwrap();
1412 }
1413
1414 std::env::set_current_dir(repo_path).unwrap();
1415
1416 let diff = Diff::new().with_stat(true);
1417 let result = diff.run();
1418
1419 assert!(result.is_ok());
1420 }
1421
1422 #[test]
1423 #[file_serial]

Callers

nothing calls this directly

Calls 8

with_statMethod · 0.80
initFunction · 0.50
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
addMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected