Tests caret position reporting using ranges.