Package org.python.pydev.editor.autoedit

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


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

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


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

    public void testIndentingWithTab3() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "class C:\n" +
                "    def m1(self):            \n" +
                "        print 1\n" +
                "";
View Full Code Here

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

    public void testWithoutSmartIndent() {
        final TestIndentPrefs prefs = new TestIndentPrefs(true, 4);
        prefs.smartIndentAfterPar = false;
        strategy.setIndentPrefs(prefs);
        String str = "" +
                "class C:\n" +
                "    def m1(self):" +
View Full Code Here

        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n        ", docCmd.text); // a single tab should go to the correct indent
    }

    public void testIndentingWithTab4() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "class C:\n" +
                "    def m1(self):            \n" +
                "        print 'a'\n" +
                "        " + //now, a 'regular' tab should happen
View Full Code Here

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

    public void testIndentingWithTab5() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "class C:\n" +
                "    def m1(self):            \n" +
                "        print 'a'\n" +
                "       " + //now, only 1 space is missing to the correct indent
View Full Code Here

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

    public void testIndentingWithTab6() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "class C:\n" +
                "    def m1(self):            \n" +
                "print 'a'" +
                "";
View Full Code Here

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

    public void testIndentingWithTab7() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "class C:\n" +
                "    def m1(self):            \n" +
                "  print 'a'" +
                "";
View Full Code Here

        assertEquals("        ", docCmd.text); // a single tab should go to the correct indent
        assertEquals(expected, doc.get()); // the spaces after the indent should be removed
    }

    public void testTabs() {
        strategy.setIndentPrefs(new TestIndentPrefs(false, 4));
        DocCmd docCmd = new DocCmd(0, 0, "\t");
        strategy.customizeDocumentCommand(new Document(""), docCmd);
        assertEquals("\t", docCmd.text);

        docCmd = new DocCmd(0, 0, "\t\t");
View Full Code Here

        strategy.customizeDocumentCommand(new Document(""), docCmd);
        assertEquals("\tabc", docCmd.text);
    }

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

        doc = "class c: #some comment";
        docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        expected = "\n" +
View Full Code Here

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

    public void testCommentsIndent2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        //test not indent more
        doc = "    # comment:";
        docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        expected = "\n" +
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.