Files
wren/test/string/subscript_range_from_too_small.wren
T
Gavin Schulz 2799fa6b58 feat: add range subscripting support for strings with CalculatedRange helper
Extract range validation logic from list_subscript into a reusable calculateRange function that handles inclusive/exclusive bounds, negative indices, and direction stepping. Add CalculatedRange struct to wren_core.h and implement string subscripting via the new helper, including comprehensive test coverage for forward, backward, negative, and half-negative ranges with proper error messages for out-of-bounds and non-integer values.
2015-01-17 07:20:56 +00:00

3 lines
75 B
Plaintext

var a = "123"
a[-4..2] // expect runtime error: Range start out of bounds.