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

Function test_diff_run_name_only_format

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

Source from the content-addressed store, hash-verified

1372 #[test]
1373 #[file_serial]
1374 fn test_diff_run_name_only_format() {
1375 let _guard = DirGuard::new();
1376
1377 let temp_dir = tempfile::tempdir().unwrap();
1378 let repo_path = temp_dir.path();
1379
1380 // Initialize repository and add a file
1381 {
1382 let repo = Repository::init(repo_path).unwrap();
1383 std::fs::write(repo_path.join("test.txt"), "Content").unwrap();
1384 let working_copy = repo.require_working_copy_id().unwrap();
1385 repo.add(working_copy, "test.txt", Default::default())
1386 .unwrap();
1387 }
1388
1389 std::env::set_current_dir(repo_path).unwrap();
1390
1391 let diff = Diff::new().with_name_only(true);
1392 let result = diff.run();
1393
1394 assert!(result.is_ok());
1395 }
1396
1397 #[test]
1398 #[file_serial]

Callers

nothing calls this directly

Calls 8

with_name_onlyMethod · 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