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

Function test_binary_content

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

Source from the content-addressed store, hash-verified

410
411#[test]
412fn test_binary_content() {
413 let (repo, _temp, repo_path) = create_test_repo();
414
415 // Create a file with binary content
416 let binary_content: Vec<u8> = vec![0x00, 0x01, 0x02, 0xFF, 0xFE, 0xFD];
417 let file_path = repo_path.join("binary.bin");
418 fs::write(&file_path, &binary_content).expect("Failed to write binary file");
419 repo.add("binary.bin", Default::default())
420 .expect("Failed to add binary file");
421 let hash = record_change(&repo, "Add binary file");
422
423 let after = repo
424 .get_file_content_after_change("binary.bin", &hash)
425 .expect("Failed to get after");
426
427 assert!(after.is_some(), "Binary content should be retrievable");
428 assert_eq!(
429 after.unwrap(),
430 binary_content,
431 "Binary content should match exactly"
432 );
433}
434
435#[test]
436#[ignore = "large-file integration case disabled pending faster default-path validation"]

Callers

nothing calls this directly

Calls 5

writeFunction · 0.85
create_test_repoFunction · 0.70
record_changeFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected