@Test
public void testFixSelectionLength() {

	String text = "";
	Assert.assertEquals( 0, TextUtils.fixSelectionLength( text, 0, -1 ));
	Assert.assertEquals( 0, TextUtils.fixSelectionLength( text, 0, 0 ));
	Assert.assertEquals( 0, TextUtils.fixSelectionLength( text, 0, 1 ));
	Assert.assertEquals( 0, TextUtils.fixSelectionLength( text, 0, 100 ));
	text = "a";
	Assert.assertEquals( 1, TextUtils.fixSelectionLength( text, 0, -1 ));
	Assert.assertEquals( 1, TextUtils.fixSelectionLength( text, 0, 0 ));
	Assert.assertEquals( 1, TextUtils.fixSelectionLength( text, 0, 1 ));
	Assert.assertEquals( 1, TextUtils.fixSelectionLength( text, 0, 100 ));
	text = "a\nb\nc";
	Assert.assertEquals( 1, TextUtils.fixSelectionLength( text, 0, -1 ));
	Assert.assertEquals( 1, TextUtils.fixSelectionLength( text, 2, 1 ));
	Assert.assertEquals( 1, TextUtils.fixSelectionLength( text, 4, 1 ));
	Assert.assertEquals( text.length(), TextUtils.fixSelectionLength( text, 0, 100 ));
}