You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Return an ordered empty range when trim_range receives only whitespace #548
trim_range combines trim_left_index and trim_right_index without reconciling an empty result. For three spaces, the helpers intentionally return 3 and 0 respectively; trim_range therefore exposes start=3, end=0. A caller calculating the trimmed length as end-start gets -3 rather than an empty range.
The individual helper behavior is already asserted by shared/test99 and need not change. The missing behavior belongs in the combined range API.
Normalize the combined empty result to an ordered zero-length range, with a short comment stating which empty offset is returned.
Cover empty input, all spaces, mixed supported whitespace, padded content and content without whitespace.
Assert 0 <= start <= end <= input length and preserve the existing individual left/right helper results.
Do not expand this patch into changing the set of whitespace characters or adding string dependencies.
Audit status: static source inspection against canonical master ea74c2dafc31da876e5561f2d176ba719f5a0458 on 2026-09-10. No compiler build, test execution, implementation change or local reproduction was performed for this report. The examples describe the source-derived behavior to verify when implementing the fix.
Activity
Fix numeric lowering and standard-library boundary handling (wavefnd#707