uxn/tests/std_tests.rs

20 lines
553 B
Rust

use std::fs::File;
use uxn::vm::*;
macro_rules! test_case {
($fname:expr) => {
concat!(env!("CARGO_MANIFEST_DIR"), "/resources/test/", $fname) // assumes Linux ('/')!
};
}
#[test]
fn reference_tests() {
let mut vm = Uxn::new();
let progf = File::open(test_case!("tests.rom")).unwrap();
vm.load_rom(progf).unwrap();
let symf = File::open(test_case!("tests.rom.sym")).unwrap();
vm.load_symbols(symf).unwrap();
assert_eq!(vm.run(0xFFFF), Err(UxnError::Break));
assert_ne!(vm.dei2(0x0000).unwrap(), 0xFFFF);
}