From e0ed86e203537a03b954eb0c64559b44c16d89b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kn=C3=BCttel?= Date: Sat, 27 Oct 2018 16:51:52 +0200 Subject: [PATCH] updated tests --- assembler/test/test_013_util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"