コード例 #1
0
def test_folding():
    doc = Document(DOC_URI, DOC)
    ranges = pyls_folding_range(doc)
    expected = [{'startLine': 1, 'endLine': 6},
                {'startLine': 2, 'endLine': 3},
                {'startLine': 5, 'endLine': 6},
                {'startLine': 8, 'endLine': 11},
                {'startLine': 12, 'endLine': 20},
                {'startLine': 13, 'endLine': 14},
                {'startLine': 15, 'endLine': 16},
                {'startLine': 17, 'endLine': 18},
                {'startLine': 19, 'endLine': 20},
                {'startLine': 22, 'endLine': 35},
                {'startLine': 23, 'endLine': 35},
                {'startLine': 24, 'endLine': 25},
                {'startLine': 27, 'endLine': 29},
                {'startLine': 28, 'endLine': 29},
                {'startLine': 30, 'endLine': 31},
                {'startLine': 32, 'endLine': 34},
                {'startLine': 33, 'endLine': 34},
                {'startLine': 38, 'endLine': 39},
                {'startLine': 41, 'endLine': 43},
                {'startLine': 42, 'endLine': 43},
                {'startLine': 45, 'endLine': 54},
                {'startLine': 47, 'endLine': 51},
                {'startLine': 49, 'endLine': 51},
                {'startLine': 50, 'endLine': 51},
                {'startLine': 52, 'endLine': 54},
                {'startLine': 53, 'endLine': 54},
                {'startLine': 56, 'endLine': 57},
                {'startLine': 59, 'endLine': 65},
                {'startLine': 60, 'endLine': 61},
                {'startLine': 62, 'endLine': 63},
                {'startLine': 64, 'endLine': 65}]
    assert ranges == expected
コード例 #2
0
ファイル: test_folding.py プロジェクト: zhoufan766/spyder
def test_folding_syntax_error(workspace):
    doc = Document(DOC_URI, workspace, SYNTAX_ERR)
    ranges = pyls_folding_range(doc)
    expected = [{'startLine': 1, 'endLine': 6},
                {'startLine': 2, 'endLine': 3},
                {'startLine': 5, 'endLine': 6},
                {'startLine': 8, 'endLine': 9},
                {'startLine': 12, 'endLine': 13},
                {'startLine': 15, 'endLine': 17},
                {'startLine': 16, 'endLine': 17},
                {'startLine': 19, 'endLine': 28},
                {'startLine': 21, 'endLine': 25},
                {'startLine': 23, 'endLine': 25},
                {'startLine': 24, 'endLine': 25},
                {'startLine': 26, 'endLine': 28},
                {'startLine': 27, 'endLine': 28}]
    assert ranges == expected