Skip to content

Commit de9cdeb

Browse files
committed
Added unittest for submodule spacing bug
1 parent fa6b6d9 commit de9cdeb

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

test/test_server.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,12 @@ def hover_request(file_path, line, char):
599599
check_return(results[10], ((3, " !! Doc 9"), (4, " !! Doc 10")))
600600

601601

602-
def test_diagnostic_interfaces():
602+
def test_diagnostics():
603603
"""
604-
Tests the diagnostics for subroutines and functions with interfaces
605-
as arguments
604+
Tests some aspects of diagnostics
606605
"""
607606
string = write_rpc_request(1, "initialize", {"rootPath": test_dir})
607+
# Test subroutines and functions with interfaces as arguments
608608
file_path = os.path.join(test_dir, "test_diagnostic_int.f90")
609609
string += write_rpc_notification(
610610
"textDocument/didOpen", {"textDocument": {"uri": file_path}}
@@ -614,6 +614,11 @@ def test_diagnostic_interfaces():
614614
string += write_rpc_notification(
615615
"textDocument/didOpen", {"textDocument": {"uri": file_path}}
616616
)
617+
# Test that submodules with spacings in their parent's names are parsed
618+
file_path = os.path.join(test_dir, "test_submodule.f90")
619+
string += write_rpc_notification(
620+
"textDocument/didOpen", {"textDocument": {"uri": file_path}}
621+
)
617622
# Example of a diagnostics message
618623
# string += write_rpc_notification(
619624
# "textDocument/publishDiagnostics",
@@ -649,4 +654,4 @@ def test_diagnostic_interfaces():
649654
test_refs()
650655
test_hover()
651656
test_docs()
652-
test_diagnostic_interfaces()
657+
test_diagnostics()

test/test_source/test_submodule.f90

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
submodule( foo_module ) submodule1
2+
implicit none
3+
contains
4+
module procedure foo1
5+
WRITE(*,"(A)") "testing :: "// trim(a) // "::"// trim(b)
6+
end procedure foo1
7+
end submodule submodule1

0 commit comments

Comments
 (0)