示例#1
0
def test_carriage_return_statements():
    source = u(dedent('''
        foo = 'ns1!'

        # this is a namespace package
    '''))
    source = source.replace('\n', '\r\n')
    stmt = Parser(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 = Parser(load_grammar(), source).module.statements[0]
    assert '#' not in stmt.get_code()
示例#3
0
def test_carriage_return_statements():
    source = u(
        dedent(
            """
        foo = 'ns1!'

        # this is a namespace package
    """
        )
    )
    source = source.replace("\n", "\r\n")
    stmt = Parser(load_grammar(), source).module.statements[0]
    assert "#" not in stmt.get_code()
示例#4
0
 def test(source, end_pos):
     module = Parser(load_grammar(), u(source)).module
     assert module.get_code() == source
     assert module.end_pos == end_pos
示例#5
0
文件: test_get_code.py 项目: ABob/vim
 def test(source, end_pos):
     module = Parser(load_grammar(), u(source)).module
     assert module.get_code() == source
     assert module.end_pos == end_pos