Skip to content

Commit b8f980d

Browse files
committed
test/boreal-py: add some test to ensure set_params works
1 parent bb11e0b commit b8f980d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

boreal-py/tests/test_scanner.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,12 +1015,16 @@ def test_set_params():
10151015
# parameters are properly tested in the boreal crate.
10161016
rules.set_params(
10171017
use_mmap=True,
1018-
string_max_nb_matches=100,
1018+
string_max_nb_matches=1,
10191019
fragmented_scan_mode="fast",
10201020
process_memory=False,
10211021
max_fetched_region_size=100,
10221022
memory_chunk_size=23,
10231023
)
1024+
# Check string_max_nb_matches to ensure parameters are properly set.
1025+
results = rules.match(data="abc abc")
1026+
s = results[0].strings[0]
1027+
assert len(s.instances) == 1
10241028

10251029
with tempfile.NamedTemporaryFile() as fp:
10261030
fp.write(b'dcabc <3>')

0 commit comments

Comments
 (0)