@@ -58,19 +58,23 @@ def __run_test(format, nbytes, expected_header, expected_prefix, use_bin_type):
5858
5959
6060def test_fixstr_from_byte ():
61+ __run_test ('B' , 1 , b'\xa1 ' , b'' , False )
6162 __run_test ('B' , 31 , b'\xbf ' , b'' , False )
6263
6364
6465def test_fixstr_from_float ():
66+ __run_test ('f' , 4 , b'\xa4 ' , b'' , False )
6567 __run_test ('f' , 28 , b'\xbc ' , b'' , False )
6668
6769
6870def test_str16_from_byte ():
6971 __run_test ('B' , 2 ** 8 , b'\xda ' , b'\x01 \x00 ' , False )
72+ __run_test ('B' , 2 ** 16 - 1 , b'\xda ' , b'\xff \xff ' , False )
7073
7174
7275def test_str16_from_float ():
7376 __run_test ('f' , 2 ** 8 , b'\xda ' , b'\x01 \x00 ' , False )
77+ __run_test ('f' , 2 ** 16 - 4 , b'\xda ' , b'\xff \xfc ' , False )
7478
7579
7680def test_str32_from_byte ():
@@ -83,18 +87,22 @@ def test_str32_from_float():
8387
8488def test_bin8_from_byte ():
8589 __run_test ('B' , 1 , b'\xc4 ' , b'\x01 ' , True )
90+ __run_test ('B' , 2 ** 8 - 1 , b'\xc4 ' , b'\xff ' , True )
8691
8792
8893def test_bin8_from_float ():
8994 __run_test ('f' , 4 , b'\xc4 ' , b'\x04 ' , True )
95+ __run_test ('f' , 2 ** 8 - 4 , b'\xc4 ' , b'\xfc ' , True )
9096
9197
9298def test_bin16_from_byte ():
9399 __run_test ('B' , 2 ** 8 , b'\xc5 ' , b'\x01 \x00 ' , True )
100+ __run_test ('B' , 2 ** 16 - 1 , b'\xc5 ' , b'\xff \xff ' , True )
94101
95102
96103def test_bin16_from_float ():
97104 __run_test ('f' , 2 ** 8 , b'\xc5 ' , b'\x01 \x00 ' , True )
105+ __run_test ('f' , 2 ** 16 - 4 , b'\xc5 ' , b'\xff \xfc ' , True )
98106
99107
100108def test_bin32_from_byte ():
0 commit comments