convert programs into tests

This commit is contained in:
2026-06-12 22:24:35 -04:00
parent 715a50b1fa
commit 571ff70fa1
13 changed files with 129 additions and 225 deletions
+13
View File
@@ -0,0 +1,13 @@
use std::{fs::OpenOptions, io::Write, os::unix::fs::OpenOptionsExt};
pub fn write(path: &str, binary: &[u8]) {
let mut file = OpenOptions::new()
.create(true)
.write(true)
.truncate(true)
.mode(0o750)
.open(path)
.expect("Failed to create file");
file.write_all(binary).expect("Failed to write to file");
file.sync_all().expect("Failed to sync file");
}