diff options
Diffstat (limited to 'tests/conformance.lua')
| -rw-r--r-- | tests/conformance.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/conformance.lua b/tests/conformance.lua index 2598ab7..b8f37cb 100644 --- a/tests/conformance.lua +++ b/tests/conformance.lua @@ -9,8 +9,11 @@ package.path = table.concat({ local composition_root = require("clever_f.composition_root") local domain = require("clever_f.domain") local sequence_state = require("clever_f.sequence_state") +local text_topology = require("clever_f.text_topology") local MemoryHost = require("clever_f.testing.memory_host") +local invariants = dofile(root .. "/tests/invariants.lua") + local NULL = vim.NIL local function is_null(value) @@ -322,7 +325,25 @@ local function run_step(context, step, step_index) if nullable(step.count) ~= nil then context.host:set_count(step.count) end + local before_state = context.state:snapshot() + local mode = context.host:read_mode() + local origin = context.host:read_cursor() + local before_view = text_topology.from_host(context.host) + local persistent_request_count = #context.feedback:persistent_requests() outcome = invoke_action(context, step.action) + invariants.after_action({ + action = step.action, + outcome = outcome, + host = context.host, + state = context.state, + coordinator = context.facade:coordinator(), + feedback = context.feedback, + before_state = before_state, + before_view = before_view, + persistent_request_count = persistent_request_count, + mode = mode, + origin = origin, + }) elseif operation == "set_cursor" then context.host:set_cursor(position(step.position)) elseif operation == "set_mode" then |
