Skip to content

Leginion/lua-script-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lua Script Lab

This is a repo full of AI-generated codes.

Test-Driven

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.

Positioning

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.

Project Structure

  • 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.

Run Tests

lua54.exe tests/init.lua

or:

run-tests.bat

Expected tail output:

Summary: total=<N> passed=<N> failed=0

Reporter Modes

Use run-tests.bat <mode> on Windows:

  • run-tests.bat -> spec (default)
  • run-tests.bat dot
  • run-tests.bat json

Or set environment variable:

$env:TEST_REPORTER="json"
lua54.exe tests/init.lua

Optional fail-fast:

$env:TEST_FAIL_FAST="1"
lua54.exe tests/init.lua

GitHub Automation

Workflow 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

About

AI Coding Exploring for Lua Scripting.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors