r3bl-org/r3bl-open-core

[tui] editor component - write lots of tests for new features that got added

Closed this issue · 2 comments

Add tests for

  • select,
  • copy,
  • cut,
  • paste,
  • delete,
  • undo,
  • redo

Considerations

  • It appears that assertions are encapsulated in functions to promote reuse e.g line_at_caret. However, when these test cases fail, the terse summary provided by the panic would point to the function call. If there are multiple such assertions , the user can't tell exactly which of their assertions had failed. As such should I expose these assertions for better debug-ability ?
  • The test cases use the EditorEvents for mocking. However, the mapping between a user event and the generation of EditorEvent is still not being verified.

Running status for Test-cases :

  • select
  • copy
  • cut
  • paste
  • delete
  • backspace
  • undo
  • redo