test case for a change in commit 4450360 (apply bidi layout algorithm only within lexical entities)

This commit is contained in:
Dmitry Batrak
2015-06-16 10:37:27 +03:00
parent 98e2386ec3
commit 3f63e8f58c
@@ -22,6 +22,7 @@ import com.intellij.openapi.editor.VisualPosition;
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.editor.impl.view.IterationState;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.testFramework.TestFileType;
import java.awt.*;
import java.io.IOException;
@@ -441,6 +442,14 @@ public class EditorRtlTest extends AbstractEditorTest {
assertFalse(it.hasPastLineEndBackgroundSegment());
}
public void testUsingLexerForBidiLayout() throws Exception {
init("class Foo {\n int<caret> " + RTL_CHAR + " = 1;\n}", TestFileType.JAVA);
right();
right();
assertEquals(RTL_CHAR, myEditor.getDocument().getCharsSequence().charAt(myEditor.getCaretModel().getOffset() - 1));
}
private void init(String text) throws IOException {
initText(text.replace(RTL_CHAR_REPRESENTATION, RTL_CHAR));
}