Skip to content

Commit f3966ae

Browse files
committed
Add test for multiline trailing docstrings
1 parent f766104 commit f3966ae

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

test/test_server.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def test_symbols():
136136
def check_return(result_array):
137137
# Expected objects
138138
objs = (
139-
["test_free", 2, 0, 79],
139+
["test_free", 2, 0, 81],
140140
["scale_type", 5, 4, 6],
141141
["val", 13, 5, 5],
142142
["vector", 5, 8, 16],
@@ -157,7 +157,7 @@ def check_return(result_array):
157157
["scaled_vector_norm", 12, 55, 59],
158158
["unscaled_norm", 12, 61, 65],
159159
["test_sig_Sub", 12, 67, 70],
160-
["bound_pass", 12, 72, 78],
160+
["bound_pass", 12, 72, 80],
161161
)
162162
assert len(result_array) == len(objs)
163163
for i, obj in enumerate(objs):
@@ -537,7 +537,7 @@ def find_in_results(uri, sline):
537537
[free_path, 36, 6, 12],
538538
[free_path, 44, 6, 12],
539539
[free_path, 50, 6, 12],
540-
[free_path, 76, 6, 12],
540+
[free_path, 78, 6, 12],
541541
),
542542
)
543543

@@ -713,7 +713,7 @@ def hover_request(file_path, line, char):
713713
string += hover_request(file_path, 22, 32)
714714
string += hover_request(file_path, 15, 32)
715715
string += hover_request(file_path, 15, 47)
716-
errcode, results = run_request(string)
716+
errcode, results = run_request(string, ["-n", "1"])
717717
assert errcode == 0
718718
#
719719
check_return(results[1], ((1, "!! Doc 1"), (3, " !! Doc 5")))
@@ -724,5 +724,8 @@ def hover_request(file_path, line, char):
724724
check_return(results[6], ((1, "!! Doc 7"), (4, " !! Doc 8")))
725725
check_return(results[7], ((1, "!! Doc 3"),))
726726
check_return(results[8], ())
727-
check_return(results[9], ())
728-
check_return(results[10], ((3, " !! Doc 9"), (4, " !! Doc 10")))
727+
check_return(results[9], ((2, " !! Doc 9"), (3, " !! Doc 10")))
728+
check_return(
729+
results[10],
730+
((2, " !! Doc 9"), (3, " !! Doc 10"), (5, " !! Doc 11"), (6, " !! Doc 12")),
731+
)

test/test_source/subdir/test_free.f90

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ SUBROUTINE test_sig_Sub(arg1,arg2,opt1,opt2,opt3)
7171
END SUBROUTINE test_sig_Sub
7272
!
7373
SUBROUTINE bound_pass(arg1, self)
74-
INTEGER(4), INTENT(in) :: arg1
75-
!> Doc 9
76-
!! Doc 10
74+
INTEGER(4), INTENT(in) :: arg1 !< Doc 9
75+
!! Doc 10
76+
77+
!> Doc 11
78+
!! Doc 12
7779
CLASS(vector), INTENT(inout) :: self
7880
self%n = arg1
7981
END SUBROUTINE bound_pass

0 commit comments

Comments
 (0)