@@ -809,6 +809,30 @@ def test_vector(self):
809809 dtype = BinaryVectorDtype .PACKED_BIT ,
810810 ) # type: ignore[call-overload]
811811
812+ def test_binaryvector_repr (self ):
813+ """Tests of repr(BinaryVector)"""
814+ data = [127 , 7 ]
815+ zero = BinaryVector ([], BinaryVectorDtype .INT8 )
816+ self .assertEqual (
817+ repr (zero ), "BinaryVector(dtype=BinaryVectorDtype.INT8, padding=0, data=[])"
818+ )
819+ one = BinaryVector (data , BinaryVectorDtype .INT8 )
820+ self .assertEqual (
821+ repr (one ), f"BinaryVector(dtype=BinaryVectorDtype.INT8, padding=0, data={ data } )"
822+ )
823+ two = BinaryVector (data , BinaryVectorDtype .FLOAT32 )
824+ self .assertEqual (
825+ repr (two ), f"BinaryVector(dtype=BinaryVectorDtype.FLOAT32, padding=0, data={ data } )"
826+ )
827+ three = BinaryVector (data , BinaryVectorDtype .FLOAT32 , padding = 0 )
828+ self .assertEqual (
829+ repr (three ), f"BinaryVector(dtype=BinaryVectorDtype.FLOAT32, padding=0, data={ data } )"
830+ )
831+ four = BinaryVector (data , BinaryVectorDtype .PACKED_BIT , padding = 3 )
832+ self .assertEqual (
833+ repr (four ), f"BinaryVector(dtype=BinaryVectorDtype.PACKED_BIT, padding=3, data={ data } )"
834+ )
835+
812836 def test_unicode_regex (self ):
813837 """Tests we do not get a segfault for C extension on unicode RegExs.
814838 This had been happening.
0 commit comments