X-Git-Url: https://code.kerkeslager.com/?p=sandbox;a=blobdiff_plain;f=serial%2Ftest_binary.py;h=8bc38112ac66bd8a4c0cadd8736fd05c4d0b9af5;hp=0463dda8a100ed4385928f44358a47634efae5a1;hb=1e8e6816c9f74de6cb6ab735fc962c7dc8b67164;hpb=b6d57a88f0a8ff62152e5a2148f77e10bf7bccbe diff --git a/serial/test_binary.py b/serial/test_binary.py index 0463dda..8bc3811 100644 --- a/serial/test_binary.py +++ b/serial/test_binary.py @@ -22,6 +22,10 @@ EXAMPLE_REPRESENTATIONS = [ (binary.TAG_INT16, -2, b'\x11\xff\xfe'), (binary.TAG_INT32, -2, b'\x12\xff\xff\xff\xfe'), (binary.TAG_INT64, -2, b'\x13\xff\xff\xff\xff\xff\xff\xff\xfe'), + (binary.TAG_BINARY, b'\xde\xad\xbe\xef', b'\x20\x00\x00\x00\x04\xde\xad\xbe\xef'), + (binary.TAG_UTF8, 'Lol!', b'\x21\x00\x00\x00\x04Lol!'), + (binary.TAG_UTF16, 'かわ', b'\x22\x00\x00\x00\x06\xff\xfeK0\x8f0'), + (binary.TAG_UTF32, '漢', b'\x23\x00\x00\x00\x08\xff\xfe\x00\x00"o\x00\x00'), ] class SerializeTests(unittest.TestCase):