Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 5689878

Browse files
committed
Add regression test for #59
1 parent cde75c8 commit 5689878

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,18 @@ def test_nonscalar_columns():
230230
os.remove(path)
231231

232232

233+
def test_get_matching_variables_performance():
234+
"""Performance regression test for #59"""
235+
import random
236+
import string
237+
import root_pandas.readwrite
238+
for n in [10, 100, 1000, 10000, 100000]:
239+
branches = [' '.join(random.choices(string.ascii_letters, k=100)) for i in range(n)]
240+
patterns = [' '.join(random.choices(string.ascii_letters, k=100)) for i in range(n)]
241+
root_pandas.readwrite.get_matching_variables(branches, patterns, fail=False)
242+
root_pandas.readwrite.get_matching_variables(branches, branches, fail=False)
243+
244+
233245
def test_noexpand_prefix():
234246
xs = np.array([1, 2, 3])
235247
df = pd.DataFrame({'x': xs})

0 commit comments

Comments
 (0)