diff --git a/assembler/test/test_013_util.py b/assembler/test/test_013_util.py index 32a5c5f..6c316bc 100644 --- a/assembler/test/test_013_util.py +++ b/assembler/test/test_013_util.py @@ -1,4 +1,4 @@ -from assembler.util import can_be_mark, can_convert_to_int, autoint +from assembler.util import can_be_mark, can_convert_to_int, autoint, int16_2_bytes def test_can_be_mark(): @@ -33,3 +33,8 @@ def test_autoint(): assert autoint("0b1010101") == 0b1010101 assert autoint("'a'") == ord("a") assert autoint("'\\n'") == ord("\n") + +def test_int16_2_bytes(): + assert int16_2_bytes(2) == b"\x02\00" + assert int16_2_bytes(0x0200) == b"\x00\x02" + assert int16_2_bytes(-1) == b"\xff\xff"