Fix signed integer parsing
This commit is contained in:
parent
eb98415994
commit
a2f5b2e08a
4 changed files with 34 additions and 2 deletions
19
test/test_cpu.ml
Normal file
19
test/test_cpu.ml
Normal file
|
@ -0,0 +1,19 @@
|
|||
open OUnit2
|
||||
|
||||
|
||||
let test_signed test_ctx =
|
||||
let n = 0xFA in
|
||||
let s = Cpu.signed_byte n in
|
||||
assert_equal s (-6)
|
||||
|
||||
|
||||
(* Name the test cases and group them together *)
|
||||
let suite =
|
||||
"suite">:::
|
||||
[
|
||||
"test signed">:: test_signed
|
||||
]
|
||||
|
||||
let () =
|
||||
run_test_tt_main suite
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue