From ae503e9498553d50cc145d26f4b3457276fc14ba Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Fri, 4 Sep 2026 17:46:24 +0200 Subject: Share test assertion helpers --- tests/host_adapter_contract.lua | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'tests/host_adapter_contract.lua') diff --git a/tests/host_adapter_contract.lua b/tests/host_adapter_contract.lua index ff369d5..5d22a85 100644 --- a/tests/host_adapter_contract.lua +++ b/tests/host_adapter_contract.lua @@ -11,19 +11,9 @@ local composition_root = require("clever_f.composition_root") local domain = require("clever_f.domain") local host_adapter = require("clever_f.host_adapter") -local function same(expected, actual, message) - if expected ~= actual then - error((message or "values differ") - .. ": expected " .. tostring(expected) - .. ", got " .. tostring(actual), 2) - end -end - -local function truthy(value, message) - if not value then - error(message or "value must be true", 2) - end -end +local assertions = dofile(root .. "/tests/assertions.lua") +local same = assertions.same +local truthy = assertions.truthy local exercised = {} local host = host_adapter.new() -- cgit v1.2.3