Package com.aptana.shared_core.utils

Examples of com.aptana.shared_core.utils.DocCmd


    public void testAfterClosePar2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "m = [a,\n" +
                "     b,";
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
                "     ";
        assertEquals(expected, docCmd.text);
View Full Code Here


    }

    public void testAfterClosePar() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "m = [a, (#comment";
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
                "         ";
        assertEquals(expected, docCmd.text);
    }
View Full Code Here

    }

    public void testAfterCloseParA() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        doc = "m = [a, otherCall(), ]";
        docCmd = new DocCmd(doc.length() - 1, 0, "\n"); //right before the last ']'
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        expected = "\n" +
                "     ";
        assertEquals(expected, docCmd.text);
    }
View Full Code Here

    }

    public void testIndent2() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        doc = "m = [a, otherCall(), ";
        docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
                "     ";
        assertEquals(expected, docCmd.text);
    }
View Full Code Here

    public void testIndent2a() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        doc = "def m2(self):\n" +
                "    m1(a, b(), )";
        docCmd = new DocCmd(doc.length() - 1, 0, "\n"); //right before the last ')'
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        expected = "\n" +
                "       ";
        assertEquals(expected, docCmd.text);
View Full Code Here

    }

    public void testIndent2b() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        doc = "m = [a, otherCall(), ]";
        docCmd = new DocCmd(doc.length() - 1, 0, "\n"); //right before the last ']'
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        expected = "\n" +
                "     ";
        assertEquals(expected, docCmd.text);
    }
View Full Code Here

    public void testIndent3() {

        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "" +
                "properties.create(a = newClass(),";
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
                "                  ";
        assertEquals(expected, docCmd.text);
View Full Code Here

    public void testIndent3a() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "" +
                "properties.create(a = newClass(),\n" +
                "                  b = newClass(),"; //don't indent after the '(' in this line, but to the default one
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
                "                  ";
        assertEquals(expected, docCmd.text);
    }
View Full Code Here

    public void testIndent4() { //even if it does not end with ',' we should indent in parenthesis
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String doc = "" +
                "properties.create(a = newClass(),\n" +
                "                  b = newClass("; //don't indent after the '(' in this line, but to the default one
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
                "                               ";
        assertEquals(expected, docCmd.text);
    }
View Full Code Here

        String doc = "" +
                "properties.create(a = newClass(),\n" +
                "                  b = newClass(\n"
                +
                "                               )"; //go to the last indentation
        DocCmd docCmd = new DocCmd(doc.length(), 0, "\n");
        strategy.customizeDocumentCommand(new Document(doc), docCmd);
        String expected = "\n" +
                "                  ";
        assertEquals(expected, docCmd.text);
    }
View Full Code Here

TOP

Related Classes of com.aptana.shared_core.utils.DocCmd

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.