Skip to content

Commit 71f0bae

Browse files
committed
refactor: remove preprocessor whitespace test
This test is problematic for a few reasons and is in need of refactoring. A summary of the issues are: - macro expansions are already covered in another test - 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.
1 parent a57c6b9 commit 71f0bae

File tree

4 files changed

+0
-76
lines changed

4 files changed

+0
-76
lines changed

test/test_preproc.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ def check_return(result_array, checks):
4242
string += hover_req(file_path, 30, 23)
4343
file_path = root_dir / "preproc_if_elif_skip.F90"
4444
string += hover_req(file_path, 30, 23)
45-
file_path = root_dir / "preproc_spacing_arg_defs.F90"
46-
string += hover_req(file_path, 11, 20)
47-
string += hover_req(file_path, 20, 17)
48-
string += hover_req(file_path, 22, 13)
4945
config = str(root_dir / ".pp_conf.json")
5046
errcode, results = run_request(string, ["--config", config])
5147
assert errcode == 0
@@ -72,9 +68,6 @@ def check_return(result_array, checks):
7268
"```fortran90\nINTEGER, PARAMETER :: res = 0+1+0+0\n```",
7369
"```fortran90\nINTEGER, PARAMETER :: res = 0+0+0+1\n```",
7470
"```fortran90\nINTEGER, PARAMETER :: res = 1+0+0+0\n```",
75-
"```fortran90\n#define MAYBEWRAP(PROCEDURE) PROCEDURE\n```",
76-
"```fortran90\nSUBROUTINE test_type_set_test()\n```",
77-
"```fortran90\n#define MACROARGS(x, y) x + y\n```",
7871
)
7972
assert len(ref_results) == len(results) - 1
8073
check_return(results[1:], ref_results)

test/test_server.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ def test_workspace_symbols():
175175
def check_return(result_array):
176176
# Expected objects
177177
objs = (
178-
["argtest", 13, 16],
179178
["test", 6, 7],
180179
["test_abstract", 2, 0],
181180
["test_associate_block", 2, 0],
@@ -197,11 +196,7 @@ def check_return(result_array):
197196
["test_str1", 13, 5],
198197
["test_str2", 13, 5],
199198
["test_sub", 6, 8],
200-
["test_type", 5, 5],
201-
["test_type_set_test", 6, 25],
202199
["test_vis_mod", 2, 0],
203-
["the_test", 13, 15],
204-
["wrap_test_type_set_test", 6, 33],
205200
)
206201
assert len(result_array) == len(objs)
207202
for i, obj in enumerate(objs):

test/test_source/pp/include/indent.h

Lines changed: 0 additions & 22 deletions
This file was deleted.

test/test_source/pp/preproc_spacing_arg_defs.F90

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)