예제 #1
0
파일: test_parser.py 프로젝트: ANtlord/jedi
def test_carriage_return_statements():
    source = u(dedent('''
        foo = 'ns1!'

        # this is a namespace package
    '''))
    source = source.replace('\n', '\r\n')
    stmt = ParserWithRecovery(load_grammar(), source).module.statements[0]
    assert '#' not in stmt.get_code()
예제 #2
0
def test_carriage_return_statements():
    source = u(
        dedent('''
        foo = 'ns1!'

        # this is a namespace package
    '''))
    source = source.replace('\n', '\r\n')
    stmt = ParserWithRecovery(load_grammar(), source).module.statements[0]
    assert '#' not in stmt.get_code()
예제 #3
0
 def test(source, end_pos):
     module = ParserWithRecovery(load_grammar(), u(source)).module
     assert module.get_code() == source
     assert module.end_pos == end_pos
예제 #4
0
 def test(source, end_pos):
     module = ParserWithRecovery(load_grammar(), u(source)).module
     assert module.get_code() == source
     assert module.end_pos == end_pos