Package com.aptana.shared_core.utils

Examples of com.aptana.shared_core.utils.DocCmd


        String str = "" +
                "while False:\n" +
                "    if foo:" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength() - "if foo:".length(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n    ", docCmd.text);
    }
View Full Code Here


                "                print 'foo'\n" +
                "        return 30\n" +
                "    " +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n    ", docCmd.text);
    }
View Full Code Here

                "                print 'foo'\n" +
                "        return 30\n" +
                "    \n" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\t");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("    ", docCmd.text);
    }
View Full Code Here

        String str = "" +
                "class C:\n" +
                "    try:" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n        ", docCmd.text);
    }
View Full Code Here

        String str = "" +
                "def a():\n" +
                "    print a" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength() - "    print a".length(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        String expected = "" +
                "def a():\n" +
                "    print a" +
                "";
View Full Code Here

        String str = "" +
                "def a():\n" +
                "    " +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength() - "    ".length(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        String expected = "" +
                "def a():\n" +
                "    " +
                "";
View Full Code Here

    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);
        assertEquals("\n", docCmd.text);

    }
View Full Code Here

    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);
        assertEquals("\n", docCmd.text);

    }
View Full Code Here

    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);
        assertEquals("    ", docCmd.text); // a single tab should go to the correct indent

    }
View Full Code Here

        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");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("        ", docCmd.text); // a single tab should go to the correct indent
    }
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.