Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit bebc005

Browse files
committed
Adds tests for incorrect bytes in decode not killing interpreter
Signed-off-by: ncordon <nacho.cordon.castillo@gmail.com>
1 parent 9dca969 commit bebc005

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

bblfsh/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,5 +579,11 @@ def testBinaryEncodeDecodePythonContext(self) -> None:
579579

580580
self.assertEqual(pyDict, decoded.load())
581581

582+
def testInvalidDecodeBytes(self) -> None:
583+
with self.assertRaises(RuntimeError):
584+
decode(b'', format = 0)
585+
with self.assertRaises(RuntimeError):
586+
decode(b'abcdef', format = 0)
587+
582588
if __name__ == "__main__":
583589
unittest.main()

0 commit comments

Comments
 (0)