From 073c756d1aff6e547134dcfb247f194784e109cb Mon Sep 17 00:00:00 2001 From: Mahmoud Hashemi Date: Sun, 19 Feb 2023 22:06:33 -0800 Subject: [PATCH] fix roundtripping tests --- tests/test_mathutils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_mathutils.py b/tests/test_mathutils.py index 38d7ae1..42915e9 100644 --- a/tests/test_mathutils.py +++ b/tests/test_mathutils.py @@ -95,9 +95,14 @@ def test_bits(): chk(Bits('11') >> 1, Bits('1')) chk(Bits('1') << 1, Bits('10')) assert Bits('0') != Bits('00') - chk( - Bits.from_bytes(Bits.from_hex(Bits('10101010').as_bytes()).as_hex()), + # test roundtrip as_/from_hex + chk(Bits.from_hex(Bits('10101010').as_hex()), Bits('10101010')) + # test roundtrip as_/from_bytes + chk( + Bits.from_bytes(Bits('10101010').as_bytes()), + Bits('10101010')) + # pile of roundtripping chk(Bits.from_int( Bits.from_bin( Bits.from_list(