Package org.python.pydev.editor.autoedit

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


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

    public void testIndentLevel3() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));

        String doc = "" +
                "a = (1, \n" +
                "  2,"; //should keep this indent, and not go to the opening bracket indent.
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
View Full Code Here


        String expected = "\n  ";
        assertEquals(expected, docCmd.text);
    }

    public void testIndentLevel() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));

        String doc = "" +
                "def m1(): #some comment\n" +
                "    print foo(a,\n" +
                "              b)";
View Full Code Here

        String expected = "\n    ";
        assertEquals(expected, docCmd.text);
    }

    public void testIndentLevel2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));

        String doc = "" +
                "def m1(): #some comment\n" +
                "    def metfoo(a,\n" +
                "               b):";
View Full Code Here

        String expected = "\n        ";
        assertEquals(expected, docCmd.text);
    }

    public void testNoIndent() {
        TestIndentPrefs prefs = new TestIndentPrefs(true, 4);
        prefs.smartIndentAfterPar = false;
        strategy.setIndentPrefs(prefs);

        String doc = "" +
                "def m1(): \n";
View Full Code Here

        String expected = "\n";
        assertEquals(expected, docCmd.text);
    }

    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);
View Full Code Here

    }

    public void testIndentSpaces() {
        //test after class xxx:\n
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "class c:";
        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 testAfterClosePar1() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "m = [a,";
        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 testAfterCloseParOnlyIndent() {
        final TestIndentPrefs prefs = new TestIndentPrefs(true, 4);
        strategy.setIndentPrefs(prefs);
        prefs.indentToParLevel = false;
        String doc = "m = [a,";
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
View Full Code Here

        assertEquals(expected, docCmd.text);

    }

    public void testAfterCloseParOnlyIndent2() {
        final TestIndentPrefs prefs = new TestIndentPrefs(true, 4);
        strategy.setIndentPrefs(prefs);
        prefs.indentToParLevel = false;
        String doc = "" +
                "class A:\n" +
                "    def m1(a,";
View Full Code Here

        assertEquals(expected, docCmd.text);

    }

    public void testAfterCloseParOnlyMultiIndent() {
        final TestIndentPrefs prefs = new TestIndentPrefs(true, 3);
        strategy.setIndentPrefs(prefs);
        prefs.indentToParLevel = false;
        prefs.indentAfterParWidth = 2;
        String doc = "" +
                "__author__ = [";
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.