disassembler: 100% line coverage

This commit is contained in:
2023-03-30 08:53:10 -05:00
parent cc3bc3a7fe
commit c1f457814d
2 changed files with 17 additions and 1 deletions

View File

@@ -189,6 +189,22 @@ mod cpu {
}
}
mod dis {
use chirp::cpu::disassembler::Insn;
use imperative_rs::InstructionSet;
#[test]
fn clone() {
let opcode = Insn::decode(&[0xeF, 0xa1]).unwrap().1; // random valid opcode
let clone = opcode.clone();
assert_eq!(opcode, clone);
}
#[test]
fn debug() {
println!("{:?}", Insn::decode(b"AA")) // "sne #41, v1"
}
}
#[test]
fn error() {
let error = chirp::error::Error::MissingRegion { region: Screen };