assertEquals(offset + 1, docCmd.caretOffset);
}
public void testElse() {
//first part of test - simple case
strategy.setIndentPrefs(new TestIndentPrefs(true, 4, true));
String strDoc = "if foo:\n" +
" print a\n" +
" else";
int initialOffset = strDoc.length();
DocCmd docCmd = new DocCmd(initialOffset, 0, ":");
Document doc = new Document(strDoc);
strategy.customizeDocumentCommand(doc, docCmd);
String expected = ":";
assertEquals(docCmd.offset, initialOffset - 4);
assertEquals(expected, docCmd.text);
assertEquals("if foo:\n" +
" print a\n" +
"else", doc.get());
//second part of test - should not dedent
strategy.setIndentPrefs(new TestIndentPrefs(true, 4, true));
strDoc = "if foo:\n" +
" if somethingElse:" +
" print a\n" +
" else";
initialOffset = strDoc.length();