This is a repo full of AI-generated codes.
This repo uses Codex & Unit Test for AI based development, base on Lua 5.4.
It provides:
- a lightweight built-in test framework (no third-party dependency),
- modular test reporters (
spec,dot,json), - GitHub Actions CI for automated verification.
This repository is intended as a reusable Lua54 logic-testing base for:
- formula verification,
- state transition testing,
- event/message flow testing,
- math and utility module testing.
The current src/core/attr, src/core/event, and src/core/mathx modules are reference implementations and test targets, not framework limitations.
src/core/: business/domain logic under test.tests/specs/: test cases grouped by topic.tests/testlib.lua: testing facade (test,assert_equal,assert_near,run).tests/lib/test_runner.lua: runner and execution flow.tests/reporters/: reporter implementations (spec,dot,json).tests/init.lua: test entrypoint.run-tests.bat: Windows convenience script.
lua54.exe tests/init.luaor:
run-tests.batExpected tail output:
Summary: total=<N> passed=<N> failed=0
Use run-tests.bat <mode> on Windows:
run-tests.bat->spec(default)run-tests.bat dotrun-tests.bat json
Or set environment variable:
$env:TEST_REPORTER="json"
lua54.exe tests/init.luaOptional fail-fast:
$env:TEST_FAIL_FAST="1"
lua54.exe tests/init.luaWorkflow file: .github/workflows/unit-tests.yml
Trigger conditions:
- push to
main/master - pull request
- manual trigger (
workflow_dispatch)
Matrix:
- OS:
ubuntu-latest,windows-latest - Lua:
5.4