feat(command-test): migrate to test-lib (manifest.lib + run_tests) (Test-Opt Phase 3.5)
Per ADR-0037 Tests-as-Libs Convention. Renamed on Gitea + moved locally. History preserved.
This commit is contained in:
6
init.lua
6
init.lua
@@ -4,7 +4,9 @@
|
|||||||
local command = require("lib-core.command")
|
local command = require("lib-core.command")
|
||||||
local T = engine.test
|
local T = engine.test
|
||||||
|
|
||||||
function init(ctx)
|
local M = {}
|
||||||
|
|
||||||
|
function M.run_tests(ctx)
|
||||||
-- Mocked-Unit Helper: closure-state simulates a module's unit-state.
|
-- Mocked-Unit Helper: closure-state simulates a module's unit-state.
|
||||||
local function make_unit(x0, y0, speed)
|
local function make_unit(x0, y0, speed)
|
||||||
local state = { x = x0, y = y0 }
|
local state = { x = x0, y = y0 }
|
||||||
@@ -85,3 +87,5 @@ function init(ctx)
|
|||||||
local ok2 = pcall(function() command.move_to({99999}, 0, 0) end)
|
local ok2 = pcall(function() command.move_to({99999}, 0, 0) end)
|
||||||
T.assert(not ok2, "move_to with unknown handle errors")
|
T.assert(not ok2, "move_to with unknown handle errors")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|||||||
11
manifest.lib
Normal file
11
manifest.lib
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"id": "lib-core.command-test",
|
||||||
|
"role": "test",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"api_min": "0.1",
|
||||||
|
"deps": [
|
||||||
|
{"id": "lib-core.command", "version": "0.1.0"},
|
||||||
|
{"id": "lib-core.input", "version": "0.4.0"},
|
||||||
|
{"id": "lib-core.camera", "version": "0.3.0"}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "lib-core.command-test",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"kind": "test-module",
|
|
||||||
"api": "^0.1",
|
|
||||||
"entry_point": "init.lua",
|
|
||||||
"deps": [
|
|
||||||
{ "id": "lib-core.command", "version": "0.1.0" },
|
|
||||||
{ "id": "lib-core.input", "version": "0.4.0" },
|
|
||||||
{ "id": "lib-core.camera", "version": "0.3.0" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user