Package org.python.pydev.editor.autoedit

Examples of org.python.pydev.editor.autoedit.TestIndentPrefs


        assertEquals(expected, docCmd.text);

    }

    public void testAfterClosePar2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "m = [a,\n" +
                "     b,";
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
View Full Code Here


        assertEquals(expected, docCmd.text);

    }

    public void testAfterClosePar() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "m = [a, (#comment";
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
                "         ";
View Full Code Here

                "         ";
        assertEquals(expected, docCmd.text);
    }

    public void testAfterCloseParA() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        doc = "m = [a, otherCall(), ]";
        docCmd = new DocCmd(doc.length() - 1, 0, "\n"); //right before the last ']'
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        expected = "\n" +
                "     ";
View Full Code Here

                "     ";
        assertEquals(expected, docCmd.text);
    }

    public void testIndent2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        doc = "m = [a, otherCall(), ";
        docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
                "     ";
View Full Code Here

                "     ";
        assertEquals(expected, docCmd.text);
    }

    public void testIndent2a() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        doc = "def m2(self):\n" +
                "    m1(a, b(), )";
        docCmd = new DocCmd(doc.length() - 1, 0, "\n"); //right before the last ')'
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        expected = "\n" +
View Full Code Here

        assertEquals(expected, docCmd.text);

    }

    public void testIndent2b() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        doc = "m = [a, otherCall(), ]";
        docCmd = new DocCmd(doc.length() - 1, 0, "\n"); //right before the last ']'
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        expected = "\n" +
                "     ";
View Full Code Here

        assertEquals(expected, docCmd.text);
    }

    public void testIndent3() {

        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "" +
                "properties.create(a = newClass(),";
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
View Full Code Here

        assertEquals(expected, docCmd.text);

    }

    public void testIndent3a() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "" +
                "properties.create(a = newClass(),\n" +
                "                  b = newClass(),"; //don't indent after the '(' in this line, but to the default one
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
View Full Code Here

                "                  ";
        assertEquals(expected, docCmd.text);
    }

    public void testIndent4() { //even if it does not end with ',' we should indent in parenthesis
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "" +
                "properties.create(a = newClass(),\n" +
                "                  b = newClass("; //don't indent after the '(' in this line, but to the default one
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
View Full Code Here

                "                               ";
        assertEquals(expected, docCmd.text);
    }

    public void testDedent5() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "" +
                "properties.create(a = newClass(),\n" +
                "                  b = newClass(\n"
                +
                "                               )"; //go to the last indentation
View Full Code Here

TOP

Related Classes of org.python.pydev.editor.autoedit.TestIndentPrefs

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.