public void testMultipleChoice() throws Exception {doTest("rule ::= a | b | c <caret>| d","rule ::= a | b | d | c");}
public void testComplexCase() throws Exception {doTest("rule ::= a | b | c c c <caret>| d [d d]","rule ::= a | b | d [d d] | c c c");}
private void doTest(/*@Language("BNF")*/ String text, /*@Language("BNF")*/ String expected) throws IOException {
myFixture.configureByText("a.bnf", text);
IntentionAction action = new BnfFlipChoiceIntention();
assertTrue("intention not available", action.isAvailable(getProject(), myFixture.getEditor(), myFixture.getFile()));
action.invoke(getProject(), myFixture.getEditor(), myFixture.getFile());
assertSameLines(expected, myFixture.getFile().getText());
}