From ce7f79ff458c7a4abb2930094ea05781eb092ed2 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 6 Jan 2019 02:14:51 -0800 Subject: some more refactoring of RegSpec, support r-b registers, additional test cases --- test/test.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/test.rs') diff --git a/test/test.rs b/test/test.rs index 83f24f9..166faff 100644 --- a/test/test.rs +++ b/test/test.rs @@ -45,6 +45,26 @@ fn test_mov() { } #[test] +fn test_stack() { + assert_eq!(&format!("{}", decode( + &[0x66, 0x41, 0x50] + ).unwrap()), "push r8w"); +} + +#[test] +fn test_prefixes() { + assert_eq!(&format!("{}", decode( + &[0x66, 0x41, 0x31, 0xc0] + ).unwrap()), "xor r8w, ax"); + assert_eq!(&format!("{}", decode( + &[0x66, 0x41, 0x32, 0xc0] + ).unwrap()), "xor al, r8b"); + assert_eq!(&format!("{}", decode( + &[0x40, 0x32, 0xc5] + ).unwrap()), "xor al, bpl"); +} + +#[test] fn test_control_flow() { assert_eq!(&format!("{}", decode( &[0x73, 0x31] -- cgit v1.1