The benchmark directory is relocated from the project root into the test directory, and all scripts, documentation links, and gitignore paths are updated accordingly. The test runner is also refactored to explicitly walk subdirectories (core, io, language, limit) instead of using a single test root, and a new test/README.md is added to document the test suite structure. Additionally, the constructor test for the Foo class is updated to add a zero-arity constructor and adjust expected output strings.
25 lines
843 B
Plaintext
25 lines
843 B
Plaintext
var s = "abçd"
|
|
IO.print(s.iterate(null)) // expect: 0
|
|
IO.print(s.iterate(0)) // expect: 1
|
|
IO.print(s.iterate(1)) // expect: 2
|
|
// Skip 3 because that's the middle of the ç sequence.
|
|
IO.print(s.iterate(2)) // expect: 4
|
|
// Iterating from the middle of a UTF-8 sequence goes to the next one.
|
|
IO.print(s.iterate(3)) // expect: 4
|
|
IO.print(s.iterate(4)) // expect: false
|
|
|
|
// Out of bounds.
|
|
IO.print(s.iterate(123)) // expect: false
|
|
IO.print(s.iterate(-1)) // expect: false
|
|
|
|
// Nothing to iterate in an empty string.
|
|
IO.print("".iterate(null)) // expect: false
|
|
|
|
// 8-bit clean.
|
|
IO.print("a\0b\0c".iterate(null)) // expect: 0
|
|
IO.print("a\0b\0c".iterate(0)) // expect: 1
|
|
IO.print("a\0b\0c".iterate(1)) // expect: 2
|
|
IO.print("a\0b\0c".iterate(2)) // expect: 3
|
|
IO.print("a\0b\0c".iterate(3)) // expect: 4
|
|
IO.print("a\0b\0c".iterate(4)) // expect: false
|