Skip to content

Test and refactor of array methods

Michael Aaron Murphy requested to merge AgustinCB:documents-and-tests into master

Created by: AgustinCB

Problem: I noticed that there's no documentation for the method split_at. To write sensitive documentation, I like to look at the tests. For the array methods, there aren't.

Solution: Because there weren't, I decided to add them. As with the string methods, tests, I'll use them to update The Book later.

Changes introduced by this pull request:

  • e2e tests for array methods.
  • Make run_examples.sh tell you the difference on fail.
  • Unit tests for the ArrayMethod struct.
  • Small refactor to reduce code duplication.
  • Small refactor on graphemes to avoid cloning the structure.

TODOs: I have the feeling that the split function can slightly optimized. I'm not sure if that's worth though, I'll have to think on a way to benchmark it first.

Fixes: I'm very slowing advancing in #570 (closed).

State: Ready for review.

Merge request reports