Examples of TestIndentPrefs


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

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

    }

    public void testIgnoreComment2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "titleEnd = ('''\n" +
                "            [#''')" + //should wrap to the start
                "";
        final Document doc = new Document(str);
View Full Code Here

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

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

    }

    public void testNewLineAfterOpeningParWithOtherContents() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "def m1(  self,";
        //        |<-- should indent here in this case, and not on the parenthesis
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
View Full Code Here

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

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

    public void testNewLineAfterReturn2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "def m1(self):\n" +
                "    return ('foo',";

        final Document doc = new Document(str);
View Full Code Here

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

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

    }

    public void testMaintainIndent() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "def moo():\n" +
                "    if not 1:\n" +
                "        print 'foo'\n" +
                "    print 'bla'" +
View Full Code Here

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

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

    }

    public void testMaintainIndent2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "def moo():\n" +
                "    if not 1:\n" +
                "        print 'foo'\n" +
                "    print 'bla'" +
View Full Code Here

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

        assertEquals(offset + 2, docCmd.caretOffset);

    }

    public void testDontChangeCursorOffset() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "def moo():\n" +
                "    if not 1:\n" +
                "        print    'foo'" +
                "";
View Full Code Here

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

        assertEquals(-1, docCmd.caretOffset); //don't change it

    }

    public void testTabIndentToLevel() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "properties.create( \n" +
                "                  a,\n" +
                "        \n" +
                "\n" + //cursor is here
View Full Code Here

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

        assertEquals("                  ", docCmd.text);

    }

    public void testTabIndentToLevel2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "class ContaminantFont( Barrier, ModelBase ):\n" +
                "    '''\n"
                +
                "    This class contains information to edit a contaminant.\n" +
View Full Code Here

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

        assertEquals("    ", docCmd.text);

    }

    public void testTabIndentToLevel3() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "class ContaminantFont( Barrier, ModelBase ):\n" +
                "    '''\n"
                +
                "    This class contains information to edit a contaminant.\n" +
View Full Code Here

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

        assertEquals("                      ", docCmd.text);

    }

    public void testNoAutoIndentClosingPar() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "newTuple = (\n" +
                "              what(),\n" + //the next line should be indented to this one, and not to the start of the indent
                "            )\n" +
                "";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.