Skip to content

Commit f9b5840

Browse files
JHenneberggnikit
authored andcommitted
Added unittest for intent(in out)
Checks for #160
1 parent 9bddd97 commit f9b5840

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

test/test_server_hover.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,3 +442,23 @@ def test_var_name_asterisk():
442442
# "CHARACTER(KIND=4, LEN=100), DIMENSION(3,4)",
443443
]
444444
validate_hover(results, ref_results)
445+
446+
447+
def test_intent():
448+
string = write_rpc_request(1, "initialize", {"rootPath": str(test_dir)})
449+
file_path = test_dir / "hover" / "intent.f90"
450+
string += hover_req(file_path, 2, 31)
451+
string += hover_req(file_path, 3, 29)
452+
string += hover_req(file_path, 4, 34)
453+
string += hover_req(file_path, 5, 35)
454+
string += hover_req(file_path, 6, 35)
455+
errcode, results = run_request(string, fortls_args=["-n", "1"])
456+
assert errcode == 0
457+
ref_results = [
458+
"""INTEGER(4), INTENT(IN)""",
459+
"""INTEGER, INTENT(OUT)""",
460+
"""INTEGER(4), INTENT(INOUT)""",
461+
"""INTEGER(4), INTENT(IN OUT)""",
462+
"""REAL, OPTIONAL, INTENT(IN)""",
463+
]
464+
validate_hover(results, ref_results)

test/test_source/hover/intent.f90

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
subroutine intent(arg1, arg2, arg3, arg4, arg5)
2+
implicit none
3+
integer(4), intent(in) :: arg1
4+
integer, intent(out) :: arg2
5+
integer(4), intent(inout) :: arg3
6+
integer(4), intent(in out) :: arg4
7+
real, optional, intent(in) :: arg5
8+
end subroutine intent

0 commit comments

Comments
 (0)