Added test for setting caret position