@@ -15,43 +15,63 @@ def validate_folding(results: list, ref: list):
15
15
assert results [i ] == ref [i ]
16
16
17
17
18
- def test_if_folding ():
18
+ def test_folding_if ():
19
19
"""Test the ranges for several blocks are correct"""
20
20
string = write_rpc_request (1 , "initialize" , {"rootPath" : str (test_dir )})
21
- file_path = test_dir / "subdir" / "test_if_folding .f90"
21
+ file_path = test_dir / "subdir" / "test_folding_if .f90"
22
22
string += folding_req (file_path )
23
23
errcode , results = run_request (string )
24
24
assert errcode == 0
25
+ print (results [1 ])
25
26
ref = [
26
- {"startLine" : 0 , "endLine" : 42 },
27
- {"startLine" : 10 , "endLine" : 20 },
28
- {"startLine" : 21 , "endLine" : 22 },
29
- {"startLine" : 11 , "endLine" : 19 },
30
- {"startLine" : 13 , "endLine" : 14 },
31
- {"startLine" : 15 , "endLine" : 16 },
32
- {"startLine" : 17 , "endLine" : 18 },
33
- {"startLine" : 30 , "endLine" : 34 },
34
- {"startLine" : 35 , "endLine" : 38 },
35
- {"startLine" : 39 , "endLine" : 40 },
36
- {"startLine" : 2 , "endLine" : 5 },
37
- {"startLine" : 25 , "endLine" : 27 },
38
- {"startLine" : 31 , "endLine" : 33 },
27
+ {"startLine" : 0 , "endLine" : 43 },
28
+ {"startLine" : 11 , "endLine" : 21 },
29
+ {"startLine" : 22 , "endLine" : 23 },
30
+ {"startLine" : 12 , "endLine" : 20 },
31
+ {"startLine" : 14 , "endLine" : 15 },
32
+ {"startLine" : 16 , "endLine" : 17 },
33
+ {"startLine" : 18 , "endLine" : 19 },
34
+ {"startLine" : 31 , "endLine" : 35 },
35
+ {"startLine" : 36 , "endLine" : 39 },
36
+ {"startLine" : 40 , "endLine" : 41 },
37
+ {"startLine" : 2 , "endLine" : 6 },
38
+ {"startLine" : 26 , "endLine" : 28 },
39
+ {"startLine" : 32 , "endLine" : 34 },
40
+ ]
41
+ validate_folding (results [1 ], ref )
42
+
43
+
44
+ def test_folding_select_case ():
45
+ """Test the ranges for several blocks are correct"""
46
+ string = write_rpc_request (1 , "initialize" , {"rootPath" : str (test_dir )})
47
+ file_path = test_dir / "subdir" / "test_folding_select_case.f90"
48
+ string += folding_req (file_path )
49
+ errcode , results = run_request (string )
50
+ assert errcode == 0
51
+ ref = [
52
+ {"startLine" : 0 , "endLine" : 14 },
53
+ {"startLine" : 4 , "endLine" : 4 },
54
+ {"startLine" : 5 , "endLine" : 6 },
55
+ {"startLine" : 7 , "endLine" : 8 },
56
+ {"startLine" : 9 , "endLine" : 10 },
57
+ {"startLine" : 11 , "endLine" : 12 },
39
58
]
40
59
validate_folding (results [1 ], ref )
41
60
42
61
43
- def test_mline_sub_folding ():
62
+ def test_folding_subroutine ():
44
63
"""Test the ranges for several blocks are correct"""
45
64
string = write_rpc_request (1 , "initialize" , {"rootPath" : str (test_dir )})
46
- file_path = test_dir / "subdir" / "test_mline_sub_folding .f90"
65
+ file_path = test_dir / "subdir" / "test_folding_subroutine .f90"
47
66
string += folding_req (file_path )
48
67
errcode , results = run_request (string )
49
68
assert errcode == 0
69
+ print (results [1 ])
50
70
ref = [
51
- {"startLine" : 0 , "endLine" : 3 },
52
- {"startLine" : 4 , "endLine" : 14 },
53
- {"startLine" : 0 , "endLine" : 4 },
54
- {"startLine" : 6 , "endLine" : 9 },
55
- {"startLine" : 12 , "endLine" : 13 },
71
+ {"startLine" : 1 , "endLine" : 4 },
72
+ {"startLine" : 5 , "endLine" : 17 },
73
+ {"startLine" : 1 , "endLine" : 5 },
74
+ {"startLine" : 8 , "endLine" : 11 },
75
+ {"startLine" : 15 , "endLine" : 16 },
56
76
]
57
77
validate_folding (results [1 ], ref )
0 commit comments