Skip to content

Commit 605482b

Browse files
committed
Added Bit test [skip ci]
1 parent 061ae69 commit 605482b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/test_bit.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from pgvector import Bit
22
import pytest
3+
import random
34

45
try:
56
import numpy as np
@@ -69,6 +70,10 @@ def test_bool(self):
6970
Bit(True) # ty: ignore[invalid-argument-type]
7071
assert str(error.value) == 'expected bytes, str, list, or ndarray'
7172

73+
def test_random(self):
74+
value = ''.join(random.choices(['0', '1'], k=random.randint(1024, 2048)))
75+
assert Bit(value).to_text() == value
76+
7277
def test_repr(self):
7378
assert repr(Bit([True, False, True])) == 'Bit(101)'
7479
assert str(Bit([True, False, True])) == 'Bit(101)'

0 commit comments

Comments
 (0)