Skip to content

Commit

Permalink
Added unittest for submodule spacing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gnikit committed Dec 21, 2021
1 parent fa6b6d9 commit de9cdeb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,12 @@ def hover_request(file_path, line, char):
check_return(results[10], ((3, " !! Doc 9"), (4, " !! Doc 10")))


def test_diagnostic_interfaces():
def test_diagnostics():
"""
Tests the diagnostics for subroutines and functions with interfaces
as arguments
Tests some aspects of diagnostics
"""
string = write_rpc_request(1, "initialize", {"rootPath": test_dir})
# Test subroutines and functions with interfaces as arguments
file_path = os.path.join(test_dir, "test_diagnostic_int.f90")
string += write_rpc_notification(
"textDocument/didOpen", {"textDocument": {"uri": file_path}}
Expand All @@ -614,6 +614,11 @@ def test_diagnostic_interfaces():
string += write_rpc_notification(
"textDocument/didOpen", {"textDocument": {"uri": file_path}}
)
# Test that submodules with spacings in their parent's names are parsed
file_path = os.path.join(test_dir, "test_submodule.f90")
string += write_rpc_notification(
"textDocument/didOpen", {"textDocument": {"uri": file_path}}
)
# Example of a diagnostics message
# string += write_rpc_notification(
# "textDocument/publishDiagnostics",
Expand Down Expand Up @@ -649,4 +654,4 @@ def test_diagnostic_interfaces():
test_refs()
test_hover()
test_docs()
test_diagnostic_interfaces()
test_diagnostics()
7 changes: 7 additions & 0 deletions test/test_source/test_submodule.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
submodule( foo_module ) submodule1
implicit none
contains
module procedure foo1
WRITE(*,"(A)") "testing :: "// trim(a) // "::"// trim(b)
end procedure foo1
end submodule submodule1

0 comments on commit de9cdeb

Please sign in to comment.