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

Function test_diff_run_with_added_file

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

Source from the content-addressed store, hash-verified

1327 #[test]
1328 #[serial]
1329 fn test_diff_run_with_added_file() {
1330 let _guard = DirGuard::new();
1331
1332 let temp_dir = tempfile::tempdir().unwrap();
1333 let repo_path = temp_dir.path();
1334
1335 // Initialize repository, create and add a file
1336 {
1337 let repo = Repository::init(repo_path).unwrap();
1338 std::fs::write(repo_path.join("new_file.txt"), "New content").unwrap();
1339 repo.add("new_file.txt", Default::default()).unwrap();
1340 }
1341
1342 std::env::set_current_dir(repo_path).unwrap();
1343
1344 let diff = Diff::new();
1345 let result = diff.run();
1346
1347 // Should succeed and show the added file
1348 assert!(result.is_ok());
1349 }
1350
1351 #[test]
1352 #[serial]

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected