Retoor software development Projects Research SearchXNG
Register Sign In

11 lines
264 B
Plaintext
Raw Normal View History

feat: abstract List's toString into generic join method on Sequence Add `join` and `join(sep)` methods to the `Sequence` class, allowing any sequence to produce a concatenated string of its elements with an optional separator. Refactor `List.toString` to delegate to `join(", ")` with bracket wrapping, removing the manual iteration logic from List. Include new test files for List, Range, and String join behavior, plus runtime error tests for non-string separators.
2015-01-24 05:45:23 +01:00
var str = "string"
IO.print(str.join("") == str) // expect: true
IO.print(str.join(", ")) // expect: s, t, r, i, n, g
feat: add 8-bit string test cases across concatenation, contains, count, ends_with, equality, index_of, iterate, iterator_value, join, starts_with, subscript, and to_string Add comprehensive test coverage for strings containing null bytes (\0) to ensure all string operations correctly handle 8-bit clean data. Tests verify that concatenation, substring search, length counting, boundary checks, equality comparisons, index lookups, iteration, joining, and conversion to string all treat embedded null bytes as regular characters rather than terminators.
2015-02-04 13:58:16 +01:00
// 8-bit clean
var ing = "a\0b\0c"
IO.print(ing.join("") == ing) // expect: true
IO.print(ing.join(", ") == "a, \0, b, \0, c") // expect: true
Reference in New Issue Copy Permalink
daf0728b12
wren/test/string/join.wren
Response time: 79ms
Mail Licenses API