From 440135573f26e1f468fb173c96b60f3bded77840 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 29 Jan 2020 20:09:49 +0100 Subject: [PATCH] tests: vint: test EOFError after first byte Since the first byte is handled separately for the sign bit, validate that we also get an EOFError if there are a few bytes but the last one also has the 0x80 bit set. Signed-off-by: Johannes Berg Reviewed-by: Rob Browning --- lib/bup/t/tvint.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/bup/t/tvint.py b/lib/bup/t/tvint.py index 0cb8d73..6bee0f3 100644 --- a/lib/bup/t/tvint.py +++ b/lib/bup/t/tvint.py @@ -38,6 +38,7 @@ def test_vint(): for x in [-x for x in values]: WVPASSEQ(encode_and_decode_vint(x), x) WVEXCEPT(EOFError, vint.read_vint, BytesIO()) + WVEXCEPT(EOFError, vint.read_vint, BytesIO(b"\x80\x80")) def encode_and_decode_bvec(x): -- 2.39.2