use std::fs::File;
use std::path::PathBuf;
use std::str::from_utf8;
pub fn read_file(name: &str) -> Vec<u8> {
let path = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()).join("assets").join(name);
let mut vec = Vec::<u8>::new();
std::io::copy(&mut File::open(path).unwrap(), &mut vec).unwrap();
vec
}
pub fn verify(name: &str, data: &[u8]) {
assert_eq!(read_file(name), data);
}
pub fn verify_str(name: &str, data: &str) {
assert_eq!(from_utf8(&read_file(name)).expect("File is not encoded"), data);
}