From 15506e2c08c87356436fc5206097814af5f29f8c 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 --- test/test_013_util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/test_013_util.py b/test/test_013_util.py index 32a5c5f..6c316bc 100644 --- a/test/test_013_util.py +++ b/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"