From 406e5ab63315bace1b7caf534d5331d0619c090b Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Mon, 17 Jun 2024 12:43:09 +0800 Subject: [PATCH] test: unpacker simple ints --- tests/unpacker_state_test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/unpacker_state_test.py b/tests/unpacker_state_test.py index 9ec9190..9e97afb 100644 --- a/tests/unpacker_state_test.py +++ b/tests/unpacker_state_test.py @@ -3,6 +3,13 @@ from twnet_parser.packer import \ from twnet_parser.packer import \ NO_SANITIZE, SANITIZE, SANITIZE_CC, SKIP_START_WHITESPACES +def test_unpack_simple_ints() -> None: + u = Unpacker(b'\x01\x02\x03\x0F') + assert u.get_int() == 1 + assert u.get_int() == 2 + assert u.get_int() == 3 + assert u.get_int() == 15 + def test_unpack_eol() -> None: u = Unpacker(b'\x01\x02\x03\x01foo\x00bar\x00') assert u.get_int() == 1