def testEncoded(self):
    file = StringIO(u'foo\nbär'.encode('utf-8'))
    stream = antlr3.InputStream(file, 'utf-8')
    stream.seek(4)
    marker1 = stream.mark()
    stream.consume()
    marker2 = stream.mark()
    stream.consume()
    marker3 = stream.mark()
    stream.rewind(marker2)
    self.failUnlessEqual(stream.markDepth, 1)
    self.failUnlessEqual(stream.index(), 5)
    self.failUnlessEqual(stream.line, 2)
    self.failUnlessEqual(stream.charPositionInLine, 1)
    self.failUnlessEqual(stream.LA(1), u'ä')
def testEncoded(self):
    file = StringIO(u'foo\nbär'.encode('utf-8'))
    stream = antlr3.InputStream(file, 'utf-8')
    stream.seek(4)
    marker1 = stream.mark()
    stream.consume()
    marker2 = stream.mark()
    stream.consume()
    marker3 = stream.mark()
    stream.rewind(marker2)
    self.failUnlessEqual(stream.markDepth, 1)
    self.failUnlessEqual(stream.index(), 5)
    self.failUnlessEqual(stream.line, 2)
    self.failUnlessEqual(stream.charPositionInLine, 1)
    self.failUnlessEqual(stream.LA(1), u'ä')