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

Function test_read_file_binary

atomic-core/src/output/filesystem/tests.rs:153–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151
152#[test]
153fn test_read_file_binary() {
154 let (dir, fs) = temp_fs();
155 let binary_data: Vec<u8> = (0..=255).collect();
156 std::fs::write(dir.path().join("binary.bin"), &binary_data).unwrap();
157
158 let mut buffer = Vec::new();
159 fs.read_file("binary.bin", &mut buffer).unwrap();
160 assert_eq!(buffer, binary_data);
161}
162
163#[test]
164fn test_read_file_appends_to_buffer() {

Callers

nothing calls this directly

Calls 5

temp_fsFunction · 0.85
writeFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45
read_fileMethod · 0.45

Tested by

no test coverage detected