def testConsume(self):
    'StringStream.consume()'
    stream = antlr3.StringStream('foo\nbar')
    stream.consume()
    self.failUnlessEqual(stream.index(), 1)
    self.failUnlessEqual(stream.charPositionInLine, 1)
    self.failUnlessEqual(stream.line, 1)
    stream.consume()
    self.failUnlessEqual(stream.index(), 2)
    self.failUnlessEqual(stream.charPositionInLine, 2)
    self.failUnlessEqual(stream.line, 1)
    stream.consume()
    self.failUnlessEqual(stream.index(), 3)
    self.failUnlessEqual(stream.charPositionInLine, 3)
    self.failUnlessEqual(stream.line, 1)
    stream.consume()
    self.failUnlessEqual(stream.index(), 4)
    self.failUnlessEqual(stream.charPositionInLine, 0)
    self.failUnlessEqual(stream.line, 2)
    stream.consume()
    self.failUnlessEqual(stream.index(), 5)
    self.failUnlessEqual(stream.charPositionInLine, 1)
    self.failUnlessEqual(stream.line, 2)
    stream.consume()
    self.failUnlessEqual(stream.index(), 6)
    self.failUnlessEqual(stream.charPositionInLine, 2)
    self.failUnlessEqual(stream.line, 2)
    stream.consume()
    self.failUnlessEqual(stream.index(), 7)
    self.failUnlessEqual(stream.charPositionInLine, 3)
    self.failUnlessEqual(stream.line, 2)
    stream.consume()
    self.failUnlessEqual(stream.index(), 7)
    self.failUnlessEqual(stream.charPositionInLine, 3)
    self.failUnlessEqual(stream.line, 2)
    stream.consume()
    self.failUnlessEqual(stream.index(), 7)
    self.failUnlessEqual(stream.charPositionInLine, 3)
    self.failUnlessEqual(stream.line, 2)
StringStream.consume()
def testConsume(self):
    
    stream = antlr3.StringStream('foo\nbar')
    stream.consume()
    self.failUnlessEqual(stream.index(), 1)
    self.failUnlessEqual(stream.charPositionInLine, 1)
    self.failUnlessEqual(stream.line, 1)
    stream.consume()
    self.failUnlessEqual(stream.index(), 2)
    self.failUnlessEqual(stream.charPositionInLine, 2)
    self.failUnlessEqual(stream.line, 1)
    stream.consume()
    self.failUnlessEqual(stream.index(), 3)
    self.failUnlessEqual(stream.charPositionInLine, 3)
    self.failUnlessEqual(stream.line, 1)
    stream.consume()
    self.failUnlessEqual(stream.index(), 4)
    self.failUnlessEqual(stream.charPositionInLine, 0)
    self.failUnlessEqual(stream.line, 2)
    stream.consume()
    self.failUnlessEqual(stream.index(), 5)
    self.failUnlessEqual(stream.charPositionInLine, 1)
    self.failUnlessEqual(stream.line, 2)
    stream.consume()
    self.failUnlessEqual(stream.index(), 6)
    self.failUnlessEqual(stream.charPositionInLine, 2)
    self.failUnlessEqual(stream.line, 2)
    stream.consume()
    self.failUnlessEqual(stream.index(), 7)
    self.failUnlessEqual(stream.charPositionInLine, 3)
    self.failUnlessEqual(stream.line, 2)
    stream.consume()
    self.failUnlessEqual(stream.index(), 7)
    self.failUnlessEqual(stream.charPositionInLine, 3)
    self.failUnlessEqual(stream.line, 2)
    stream.consume()
    self.failUnlessEqual(stream.index(), 7)
    self.failUnlessEqual(stream.charPositionInLine, 3)
    self.failUnlessEqual(stream.line, 2)