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

Function test_slice_of_split

scripts/test_stringzilla.py:804–817  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

802
803
804def test_slice_of_split():
805 def impl(native_str: str):
806 native_split = native_str.split()
807 text = sz.Str(native_str)
808 sz_split = text.split()
809 for slice_idx in range(len(native_split)):
810 assert str(sz_split[slice_idx]) == native_split[slice_idx]
811
812 native_str = "Weebles wobble before they fall down, don't they?"
813 impl(native_str)
814 # ~5GB to overflow 32-bit sizes
815 copies = int(len(native_str) / 5e9)
816 # Eek. Cover 64-bit indices
817 impl(native_str * copies)
818
819
820def get_random_string(

Callers

nothing calls this directly

Calls 1

implFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…