@@ -13,23 +13,25 @@ local dap_configuration
13
13
local function get_strategy_config (strategy , program , args )
14
14
local cfg = {
15
15
dap = function ()
16
- vim .validate ({ dap = {
17
- dap_configuration ,
18
- function (val )
19
- local valid = type (val ) == " table" and not vim .tbl_isempty (val )
20
-
21
- return valid , " Configure `dap` field (like in dap.configurations.php) before using this strategy"
22
- end ,
23
- " not empty table"
24
- }})
16
+ vim .validate ({
17
+ dap = {
18
+ dap_configuration ,
19
+ function (val )
20
+ local valid = type (val ) == " table" and not vim .tbl_isempty (val )
21
+
22
+ return valid , " Configure `dap` field (like in dap.configurations.php) before using this strategy"
23
+ end ,
24
+ " not empty table" ,
25
+ },
26
+ })
25
27
vim .validate ({
26
28
phpunit_cmd = {
27
29
program ,
28
- function (val )
30
+ function (val )
29
31
return type (val ) == " string" , " For `dap` strategy `phpunit_cmd` must be (or return) string."
30
32
end ,
31
33
" string" ,
32
- }
34
+ },
33
35
})
34
36
35
37
return vim .tbl_extend (" keep" , {
@@ -61,12 +63,16 @@ function NeotestAdapter.root(dir)
61
63
62
64
for _ , root_ignore_file in ipairs (config .get_root_ignore_files ()) do
63
65
result = lib .files .match_root_pattern (root_ignore_file )(dir )
64
- if result then return nil end
66
+ if result then
67
+ return nil
68
+ end
65
69
end
66
70
67
71
for _ , root_file in ipairs (config .get_root_files ()) do
68
72
result = lib .files .match_root_pattern (root_file )(dir )
69
- if result then break end
73
+ if result then
74
+ break
75
+ end
70
76
end
71
77
72
78
return result
85
91
--- @return boolean
86
92
function NeotestAdapter .filter_dir (name )
87
93
for _ , filter_dir in ipairs (config .get_filter_dirs ()) do
88
- if name == filter_dir then return false end
94
+ if name == filter_dir then
95
+ return false
96
+ end
89
97
end
90
98
91
99
return true
@@ -121,7 +129,6 @@ function NeotestAdapter.discover_positions(path)
121
129
})
122
130
end
123
131
124
-
125
132
--- @param args neotest.RunArgs
126
133
--- @return neotest.RunSpec | nil
127
134
function NeotestAdapter .build_spec (args )
@@ -137,7 +144,7 @@ function NeotestAdapter.build_spec(args)
137
144
if position .type == " test" then
138
145
local filter_args = vim .tbl_flatten ({
139
146
" --filter" ,
140
- ' :: ' .. position .name .. ' ( with data set .*)?$' ,
147
+ " :: " .. position .name .. " ( with data set .*)?$" ,
141
148
})
142
149
143
150
logger .info (" position.path:" , { position .path })
@@ -154,6 +161,8 @@ function NeotestAdapter.build_spec(args)
154
161
script_args ,
155
162
})
156
163
164
+ logger .trace (" PHPUnit command: " , { command })
165
+
157
166
--- @type neotest.RunSpec
158
167
return {
159
168
command = command ,
@@ -191,6 +200,7 @@ function NeotestAdapter.results(test, result, tree)
191
200
return {}
192
201
end
193
202
203
+ logger .trace (" Results:" , results )
194
204
return results
195
205
end
196
206
@@ -231,7 +241,7 @@ setmetatable(NeotestAdapter, {
231
241
if is_callable (opts .env ) then
232
242
config .get_env = opts .env
233
243
elseif type (opts .env ) == " table" then
234
- config .get_env = function ()
244
+ config .get_env = function ()
235
245
return opts .env
236
246
end
237
247
end
0 commit comments