def test_time(): source = open('flynote.py').read() loops = 10 t = time.time() for _ in range(loops): fastcheck(source) elapsed = time.time()-t print int((4734*loops) / elapsed), 'lines per second'
def test_eof2(): eq( fastcheck(' x=5'), {'errline': 1, 'src': ' x=5', 'errpos': 1, 'msg': 'unexpected indent'} )
def test_eof1(): eq( fastcheck('x='), {'errline': 1, 'msg': 'unexpected EOF while parsing', 'errpos': 2, 'src': 'x='})
def test_eof5(): eq( fastcheck('x=5)'), {'errline': 1, 'src': 'x=5)', 'errpos': 4, 'msg': 'unexpected EOF while parsing'})
def test_eof4(): eq( fastcheck('x=5\n y=3'), {'errline': 2, 'src': ' y=3', 'errpos': 1, 'msg': 'unexpected indent'})
def test_eof3(): eq( fastcheck('x=5\nif 1: y=3'), None)