Conformance Examples 0.1.0 — Transforms: transform-slice¶
slice-one-arg-mid-string¶
Single offset returns 1 character at that position.
Template
Context
Output
slice-two-args¶
Offset + length returns a substring of the requested length.
Template
Context
Output
slice-negative-offset¶
Negative offset counts from the end.
Template
Context
Output
slice-length-exceeds-remaining¶
Length is clamped to the remaining string.
Template
Context
Output
slice-offset-fully-out-of-bounds¶
Positive offset past end yields empty string.
Template
Context
Output
slice-negative-offset-out-of-bounds¶
Negative offset past start yields empty string.
Template
Context
Output
slice-non-integer-offset-is-null¶
Non-integer offset is a soft failure, so slice yields null.
Template
Context
Output
slice-negative-length-is-null¶
Negative length is a soft failure, so slice yields null.
Template
Context
Output
slice-non-integer-length-is-null¶
Non-integer length is a soft failure, so slice yields null.
Template
Context
Output
slice-astral-does-not-split-surrogate¶
Offsets count code points, so a surrogate pair is sliced out whole rather than split into a lone half.
Template
Context
Output
Source fixture: transforms/transform-slice.json