MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / test_bytesum_random

Function test_bytesum_random

scripts/test_stringzilla.py:1049–1055  ·  view source on GitHub ↗
(length: int, seed_value: int)

Source from the content-addressed store, hash-verified

1047@pytest.mark.parametrize("length", list(range(0, 300)) + [1024, 4096, 100000])
1048@pytest.mark.parametrize("seed_value", SEED_VALUES)
1049def test_bytesum_random(length: int, seed_value: int):
1050 def sum_bytes(body: str) -> int:
1051 return sum([ord(c) for c in body])
1052
1053 seed_random_generators(seed_value)
1054 body = get_random_string(length=length)
1055 assert sum_bytes(body) == sz.bytesum(body)
1056
1057
1058@pytest.mark.parametrize("length", [0, 1, 3, 7, 15, 31, 63, 64, 65, 127, 128, 129, 255, 256, 1000, 4096, 10000])

Callers

nothing calls this directly

Calls 4

sum_bytesFunction · 0.85
seed_random_generatorsFunction · 0.70
get_random_stringFunction · 0.70
bytesumMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…