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

Function test_untracked_file

atomic-repository/tests/state_based_diff_test.rs:347–362  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

345
346#[test]
347fn test_untracked_file() {
348 let (repo, _temp, _repo_path) = create_test_repo();
349
350 // Create a change hash to test with (but don't actually record anything)
351 let fake_hash = Hash::of(b"some hash");
352
353 // Try to get content for an untracked file
354 let before = repo.get_file_content_before_change("nonexistent.txt", &fake_hash);
355 let after = repo.get_file_content_after_change("nonexistent.txt", &fake_hash);
356
357 // Should return Ok(None) for untracked files
358 assert!(before.is_ok());
359 assert!(before.unwrap().is_none());
360 assert!(after.is_ok());
361 assert!(after.unwrap().is_none());
362}
363
364// Edge Case Tests
365

Callers

nothing calls this directly

Calls 3

create_test_repoFunction · 0.70

Tested by

no test coverage detected