Package org.python.pydev.core.docutils

Examples of org.python.pydev.core.docutils.PythonCodeReader


    protected void tearDown() throws Exception {
        super.tearDown();
    }

    public void testForward() throws Exception {
        reader = new PythonCodeReader();
        doc = new Document("fe");
        reader.configureForwardReader(doc, 0, doc.getLength(), true, true, true);
        assertEquals('f', reader.read());
        assertEquals('e', reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
View Full Code Here


        assertEquals('e', reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
    }

    public void testBackward() throws Exception {
        reader = new PythonCodeReader();
        doc = new Document("fe");
        reader.configureBackwardReader(doc, doc.getLength(), true, true, true);
        assertEquals('e', reader.read());
        assertEquals('f', reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
View Full Code Here

        assertEquals('f', reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
    }

    public void testBackwardLiterals() throws Exception {
        reader = new PythonCodeReader();
        doc = new Document("fe\n'lit'\n");
        reader.configureBackwardReader(doc, doc.getLength(), true, true, true);
        assertEquals('\n', (char) reader.read());
        assertEquals('\n', (char) reader.read());
        assertEquals('e', (char) reader.read());
View Full Code Here

        assertEquals('f', (char) reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
    }

    public void testBackwardLiterals2() throws Exception {
        reader = new PythonCodeReader();
        doc = new Document("fe\n\"lit\"\n");
        reader.configureBackwardReader(doc, doc.getLength(), true, true, true);
        assertEquals('\n', (char) reader.read());
        assertEquals('\n', (char) reader.read());
        assertEquals('e', (char) reader.read());
View Full Code Here

        assertEquals('f', (char) reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
    }

    public void testBackwardLiterals3() throws Exception {
        reader = new PythonCodeReader();
        doc = new Document("fe\n'''lit'''\n");
        reader.configureBackwardReader(doc, doc.getLength(), true, true, true);
        assertEquals('\n', (char) reader.read());
        assertEquals('\n', (char) reader.read());
        assertEquals('e', (char) reader.read());
View Full Code Here

        assertEquals('f', (char) reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
    }

    public void testBackwardLiterals4() throws Exception {
        reader = new PythonCodeReader();
        doc = new Document("fe\n'''li't'''\n");
        reader.configureBackwardReader(doc, doc.getLength(), true, true, true);
        assertEquals('\n', (char) reader.read());
        assertEquals('\n', (char) reader.read());
        assertEquals('e', (char) reader.read());
View Full Code Here

        assertEquals('f', (char) reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
    }

    public void testBackwardLiterals5() throws Exception {
        reader = new PythonCodeReader();
        doc = new Document("''\n");
        reader.configureBackwardReader(doc, doc.getLength(), true, true, true);
        assertEquals('\n', (char) reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
    }
View Full Code Here

        assertEquals('\n', (char) reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
    }

    public void testBackwardLiterals6() throws Exception {
        reader = new PythonCodeReader();
        doc = new Document("''''\n");
        reader.configureBackwardReader(doc, doc.getLength(), true, true, true);
        assertEquals('\n', (char) reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
    }
View Full Code Here

        assertEquals('\n', (char) reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
    }

    public void testBackwardComments() throws Exception {
        reader = new PythonCodeReader();
        doc = new Document("fe\n#foo");
        reader.configureBackwardReader(doc, doc.getLength(), true, true, true);
        assertEquals('#', (char) reader.read());
        assertEquals('\n', (char) reader.read());
        assertEquals('e', (char) reader.read());
View Full Code Here

        assertEquals('f', (char) reader.read());
        assertEquals(PythonCodeReader.EOF, reader.read());
    }

    public void testForwardComments() throws Exception {
        reader = new PythonCodeReader();
        doc = new Document("fe\n#too\nh");
        reader.configureForwardReader(doc, 0, doc.getLength(), true, true, true);
        assertEquals('f', (char) reader.read());
        assertEquals('e', (char) reader.read());
        assertEquals('\n', (char) reader.read());
View Full Code Here

TOP

Related Classes of org.python.pydev.core.docutils.PythonCodeReader

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.