Package org.python.pydev.editor.autoedit

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


        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n    ", docCmd.text);
    }

    public void testIndent() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "while False:\n" +
                "    if foo:" +
                "";
        final Document doc = new Document(str);
View Full Code Here


        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n    ", docCmd.text);
    }

    public void testIndentAfterRet() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "class Foo:\n" +
                "    def m1():\n" +
                "        for a in b:\n" +
                "            if a = 20:\n"
View Full Code Here

        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n    ", docCmd.text);
    }

    public void testIndentAfterRet2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "class Foo:\n" +
                "    def m1():\n" +
                "        for a in b:\n" +
                "            if a = 20:\n"
View Full Code Here

        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("    ", docCmd.text);
    }

    public void testNewLine9() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "class C:\n" +
                "    try:" +
                "";
        final Document doc = new Document(str);
View Full Code Here

        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n        ", docCmd.text);
    }

    public void testNewLine4() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "def a():\n" +
                "    print a" +
                "";
        final Document doc = new Document(str);
View Full Code Here

        assertEquals("\n", docCmd.text);

    }

    public void testNewLine5() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "def a():\n" +
                "    " +
                "";
        final Document doc = new Document(str);
View Full Code Here

        assertEquals(expected, doc.get());
        assertEquals("\n", docCmd.text);
    }

    public void testNewLine() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "createintervention() #create " +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
View Full Code Here

        assertEquals("\n", docCmd.text);

    }

    public void testNewLine2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "err)" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
View Full Code Here

        assertEquals("\n", docCmd.text);

    }

    public void testTabInComment() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "#comment" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\t");
        strategy.customizeDocumentCommand(doc, docCmd);
View Full Code Here

        assertEquals("    ", docCmd.text); // a single tab should go to the correct indent

    }

    public void testIndentingWithTab() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "class C:\n" +
                "    def m1(self):\n" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\t");
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.