Add tests for appendCharsAtCursor