MCPcopy Create free account
hub / github.com/Nariod/RustPacker / test_write_to_file_and_read_back

Function test_write_to_file_and_read_back

src/tools.rs:140–151  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138
139 #[test]
140 fn test_write_to_file_and_read_back() {
141 let dir = std::env::temp_dir().join("rustpacker_test_tools_write");
142 fs::create_dir_all(&dir).unwrap();
143 let path = dir.join("test_output.bin");
144 let content: Vec<u8> = vec![0xCA, 0xFE, 0xBA, 0xBE];
145
146 write_to_file(&content, &path).unwrap();
147 let read_back = fs::read(&path).unwrap();
148 assert_eq!(read_back, content);
149
150 fs::remove_dir_all(&dir).unwrap();
151 }
152
153 #[test]
154 fn test_absolute_path_already_absolute() {

Callers

nothing calls this directly

Calls 1

write_to_fileFunction · 0.85

Tested by

no test coverage detected