aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fuzzer_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fuzzer_spec.lua')
-rw-r--r--tests/fuzzer_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/fuzzer_spec.lua b/tests/fuzzer_spec.lua
index fc68680..c47f1e5 100644
--- a/tests/fuzzer_spec.lua
+++ b/tests/fuzzer_spec.lua
@@ -97,6 +97,7 @@ describe("fuzzer", function()
end
local function make_edits(lines)
+ local was_empty = table.concat(lines):match("^%s*$")
lines = vim.deepcopy(lines)
for _ = 1, math.random(0, 3) do
do_insert(lines)
@@ -107,6 +108,12 @@ describe("fuzzer", function()
for _ = 1, math.random(0, 3) do
do_delete(lines)
end
+ -- avoid blank output (whitepsace only) which is ignored when applying formatting
+ if not was_empty then
+ while table.concat(lines):match("^%s*$") do
+ do_replace(lines)
+ end
+ end
return lines
end