Package org.python.pydev.editor.autoedit

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


        assertEquals(expected, docCmd.text);
    }

    public void testNoSmartIndent() {

        TestIndentPrefs prefs = new TestIndentPrefs(false, 4, true);
        prefs.smartIndentAfterPar = false;
        strategy.setIndentPrefs(prefs);

        String doc = null;
        DocCmd docCmd = null;
View Full Code Here


    }

    public void testIndentTabs() {
        //test after class xxx:\n
        strategy.setIndentPrefs(new TestIndentPrefs(false, 4));
        String doc = "class c:";
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
                "\t";
        assertEquals(expected, docCmd.text);

        //test after class xxx:  \n
        strategy.setIndentPrefs(new TestIndentPrefs(false, 4));
        doc = "class c:  ";
        docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        expected = "\n" +
                "\t";
View Full Code Here

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

    public void testAutoClose() {
        strategy.setIndentPrefs(new TestIndentPrefs(false, 4, true));
        String doc = "class c(object): ";
        DocCmd docCmd = new DocCmd(doc.length(), 0, "[");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "[]";
        assertEquals(expected, docCmd.text);
View Full Code Here

        assertEquals(expected, docCmd.text);

    }

    public void testAutoSelf() {
        TestIndentPrefs testIndentPrefs = new TestIndentPrefs(false, 4, true);
        testIndentPrefs.autoAddSelf = false;
        strategy.setIndentPrefs(testIndentPrefs);
        String doc = null;
        DocCmd docCmd = null;
        String expected = null;
View Full Code Here

        assertEquals(expected, docCmd.text);

    }

    public void testAutoSelf1() {
        strategy.setIndentPrefs(new TestIndentPrefs(false, 4, true));
        String doc = "" +
                "def m1():\n" +
                "    def m2():\n" +
                "        pass\n" +
                "    def m2" +
View Full Code Here

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

    public void testAutoSelf2() {
        strategy.setIndentPrefs(new TestIndentPrefs(false, 4, true));
        String doc = "" +
                "class A:\n" +
                "\n" +
                "    @staticmethod\n" +
                "    def m2():\n" +
View Full Code Here

        String expected = "(self):";
        assertEquals(expected, docCmd.text);
    }

    public void testAutoCls() {
        TestIndentPrefs testIndentPrefs = new TestIndentPrefs(false, 4, true);
        strategy.setIndentPrefs(testIndentPrefs);
        String doc = null;
        DocCmd docCmd = null;
        String expected = null;
View Full Code Here

        assertEquals(expected, docCmd.text);

    }

    public void testNoAutoSelf() {
        TestIndentPrefs testIndentPrefs = new TestIndentPrefs(false, 4, true);
        strategy.setIndentPrefs(testIndentPrefs);
        String doc = null;
        DocCmd docCmd = null;
        String expected = null;
View Full Code Here

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

    public void testSmartIndent() {
        TestIndentPrefs testIndentPrefs = new TestIndentPrefs(true, 4);
        strategy.setIndentPrefs(testIndentPrefs);
        String doc = null;
        DocCmd docCmd = null;
        String expected = null;
View Full Code Here

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

    public void testNoAutoSelf2() {
        TestIndentPrefs testIndentPrefs = new TestIndentPrefs(false, 4, true);
        strategy.setIndentPrefs(testIndentPrefs);
        String doc = null;
        DocCmd docCmd = null;
        String expected = null;
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.