Skip to content

Commit

Permalink
refactor: remove preprocessor whitespace test
Browse files Browse the repository at this point in the history
This test is problematic for a few reasons and is in need of refactoring. A summary of the issues are:
- test too big
- it pollutes the global workspace of symbols
- names of objects are too generic
- tests indirectly the preprocessor

Its purpose in this PR is to test the preprocessor REGEX patterns work
with leading whitespaces and can perform macro expansions.
I have opted to remove and write a more compact test.
  • Loading branch information
gnikit committed Apr 13, 2024
1 parent a57c6b9 commit f02e58b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 76 deletions.
7 changes: 0 additions & 7 deletions test/test_preproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ def check_return(result_array, checks):
string += hover_req(file_path, 30, 23)
file_path = root_dir / "preproc_if_elif_skip.F90"
string += hover_req(file_path, 30, 23)
file_path = root_dir / "preproc_spacing_arg_defs.F90"
string += hover_req(file_path, 11, 20)
string += hover_req(file_path, 20, 17)
string += hover_req(file_path, 22, 13)
config = str(root_dir / ".pp_conf.json")
errcode, results = run_request(string, ["--config", config])
assert errcode == 0
Expand All @@ -72,9 +68,6 @@ def check_return(result_array, checks):
"```fortran90\nINTEGER, PARAMETER :: res = 0+1+0+0\n```",
"```fortran90\nINTEGER, PARAMETER :: res = 0+0+0+1\n```",
"```fortran90\nINTEGER, PARAMETER :: res = 1+0+0+0\n```",
"```fortran90\n#define MAYBEWRAP(PROCEDURE) PROCEDURE\n```",
"```fortran90\nSUBROUTINE test_type_set_test()\n```",
"```fortran90\n#define MACROARGS(x, y) x + y\n```",
)
assert len(ref_results) == len(results) - 1
check_return(results[1:], ref_results)
5 changes: 0 additions & 5 deletions test/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ def test_workspace_symbols():
def check_return(result_array):
# Expected objects
objs = (
["argtest", 13, 16],
["test", 6, 7],
["test_abstract", 2, 0],
["test_associate_block", 2, 0],
Expand All @@ -197,11 +196,7 @@ def check_return(result_array):
["test_str1", 13, 5],
["test_str2", 13, 5],
["test_sub", 6, 8],
["test_type", 5, 5],
["test_type_set_test", 6, 25],
["test_vis_mod", 2, 0],
["the_test", 13, 15],
["wrap_test_type_set_test", 6, 33],
)
assert len(result_array) == len(objs)
for i, obj in enumerate(objs):
Expand Down
22 changes: 0 additions & 22 deletions test/test_source/pp/include/indent.h

This file was deleted.

42 changes: 0 additions & 42 deletions test/test_source/pp/preproc_spacing_arg_defs.F90

This file was deleted.

0 comments on commit f02e58b

Please sign in to comment.