Couple bugfixes, integration tests ported

This commit is contained in:
2022-04-17 23:35:48 -05:00
parent df111ce55b
commit 05c1be2e94
16 changed files with 436 additions and 48 deletions
+7
View File
@@ -1,3 +1,5 @@
use std::fmt::{Display, Formatter};
// 128k, the amount of memory in a standard Vulcan machine
pub const MEM_SIZE: u32 = 128 * 1024;
@@ -45,6 +47,11 @@ impl From<Word> for u32 {
}
}
impl Display for Word {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", i32::from(*self))
}
}
#[test]
fn to_from_u32() {
assert_eq!(u32::from(Word::from(0x123456u32)), 0x123456u32);