public void testDedent() {
strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
String doc = "def m1(): #some comment\n" +
" return 10";
DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
strategy.customizeDocumentCommand(new Document(doc), docCmd);
String expected = "\n";
assertEquals(expected, docCmd.text);
//test ending with
doc = "def m1(): #some comment\n" +
" return";
docCmd = new DocCmd(doc.length(), 0, "\n");
strategy.customizeDocumentCommand(new Document(doc), docCmd);
expected = "\n";
assertEquals(expected, docCmd.text);
//test not dedenting
doc = "def m1(): #some comment\n" +
" returnIs10 = 10";
docCmd = new DocCmd(doc.length(), 0, "\n");
strategy.customizeDocumentCommand(new Document(doc), docCmd);
expected = "\n" +
" ";
assertEquals(expected, docCmd.text);