def testToString(self):
    'CommonTokenStream.toString()'
    self.source.tokens.append(antlr3.CommonToken(type=12, text='foo'))
    self.source.tokens.append(antlr3.CommonToken(type=13, text='bar'))
    self.source.tokens.append(antlr3.CommonToken(type=14, text='gnurz'))
    self.source.tokens.append(antlr3.CommonToken(type=15, text='blarz'))
    stream = antlr3.CommonTokenStream(self.source)
    assert (stream.toString() == 'foobargnurzblarz')
    assert (stream.toString(1, 2) == 'bargnurz')
    assert (stream.toString(stream.tokens[1], stream.tokens[(- 2)]) == 'bargnurz')
CommonTokenStream.toString()
def testToString(self):
    
    self.source.tokens.append(antlr3.CommonToken(type=12, text='foo'))
    self.source.tokens.append(antlr3.CommonToken(type=13, text='bar'))
    self.source.tokens.append(antlr3.CommonToken(type=14, text='gnurz'))
    self.source.tokens.append(antlr3.CommonToken(type=15, text='blarz'))
    stream = antlr3.CommonTokenStream(self.source)
    assert (stream.toString() == 'foobargnurzblarz')
    assert (stream.toString(1, 2) == 'bargnurz')
    assert (stream.toString(stream.tokens[1], stream.tokens[(- 2)]) == 'bargnurz')