summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 345f146..1906c6d 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -7129,6 +7129,30 @@ test("Primary preflight opens folds for horizontal and all policies", function()
same(2, host:read_fold_state().closed_levels)
end)
+test("Primary preflight repeats fold opening until the line is visible", function()
+ local host = MemoryHost.new({
+ fold_open_policy = { "horizontal" },
+ closed_fold_levels = 3,
+ })
+ sequence_coordinator.new({ host = host }):primary("t")
+
+ local fold_operations = {}
+ for _, operation in ipairs(host:operations()) do
+ if operation.operation == "read_fold_state"
+ or operation.operation == "open_fold"
+ then
+ fold_operations[#fold_operations + 1] = operation.operation
+ end
+ end
+ list_same({
+ "read_fold_state",
+ "open_fold", "read_fold_state",
+ "open_fold", "read_fold_state",
+ "open_fold", "read_fold_state",
+ }, fold_operations)
+ same(0, host:read_fold_state().closed_levels)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then