tangled
alpha
login
or
join now
algmyr.se
/
vclib.nvim
0
fork
atom
Common library code for other vc*.nvim projects.
0
fork
atom
overview
issues
pulls
pipelines
Revamp output format a bit.
algmyr.se
1 month ago
ff2adfc9
3077da8f
+22
-14
1 changed file
expand all
collapse all
unified
split
lua
vclib
testing.lua
+22
-14
lua/vclib/testing.lua
···
151
151
152
152
local symbol
153
153
local outcome
154
154
+
local name = suite_name
154
155
local timing = string.format("(%.1fms)", duration_ms)
155
155
-
if suite_failed == 0 then
156
156
-
symbol = colorize("✓", PASS)
157
157
-
outcome = string.format("(all %d passed)", suite_total)
156
156
+
local blocks
157
157
+
if suite_total == 0 then
158
158
+
symbol = colorize("-", NOTE)
159
159
+
name = colorize(suite_name, NOTE)
160
160
+
blocks = { symbol, name }
158
161
else
159
159
-
symbol = colorize("✗", FAIL)
160
160
-
outcome = string.format("(%d/%d failed)", suite_failed, suite_total)
162
162
+
if suite_failed == 0 then
163
163
+
symbol = colorize("✓", PASS)
164
164
+
outcome = string.format("(all %d passed)", suite_total)
165
165
+
blocks = { symbol, suite_name, outcome, timing }
166
166
+
else
167
167
+
symbol = colorize("✗", FAIL)
168
168
+
outcome = string.format("(%d/%d failed)", suite_failed, suite_total)
169
169
+
blocks = { symbol, suite_name, outcome, timing }
170
170
+
end
161
171
end
162
162
-
output { symbol, suite_name, outcome, timing }
163
163
-
if suite_skipped > 0 then
164
164
-
output {
165
165
-
" ",
166
166
-
string.format(
167
167
-
colorize("%d tests were skipped due to filtering", NOTE),
168
168
-
suite_skipped
169
169
-
),
170
170
-
}
172
172
+
if suite_skipped > 0 and suite_total == 0 then
173
173
+
blocks[#blocks + 1] =
174
174
+
colorize(string.format("(all %d skipped)", suite_skipped), NOTE)
175
175
+
else
176
176
+
blocks[#blocks + 1] =
177
177
+
colorize(string.format("(%d skipped)", suite_skipped), NOTE)
171
178
end
179
179
+
output(blocks)
172
180
return suite_failed, suite_total, suite_skipped
173
181
end
174
182