public void testDrawUnselectedText() throws BadLocationException {
textArea.setText("line1\nline2");
Graphics g = textArea.getGraphics();
g.setFont(textArea.getFont());
FontMetrics m = g.getFontMetrics();
assertEquals(m.charWidth('l'), view.drawUnselectedText(g, 0, 0, 0, 1));
assertEquals(5 + m.charWidth('l'), view.drawUnselectedText(g, 5, 0, 0, 1));
assertEquals(m.stringWidth("line1"), view.drawUnselectedText(g, 0, 0, 0, 5));
assertEquals(m.stringWidth("line1\nli"), view.drawUnselectedText(g, 0, 0, 0, 8));
try {
view.drawUnselectedText(g, 0, 0, -1, 1);