Luacat
unit testing, logger, OOP, string, table extensions for lua.
Install / Use
/learn @wookay/LuacatREADME
luacat
unit testing, logger, OOP, string, table extensions for lua.
Unit Testing
package.path = package.path .. ";../luacat/?.lua"
require 'luacat'
function test_luacat()
assert_equal(0, 0)
end
if is_main() then
UnitTest.run()
end
$ lua test_luacat.lua
Started
.
Finished in 0.0001 seconds.
1 tests, 1 assertions, 0 failures, 0 errors
Logger
log_info( 123 )
log_info( "abc" )
log_info( {1, 2, 3} )
log_info( {a = 1, b = 2} )
log_info( "test %d %s", 123, "abc")
test_logger.lua:9 123
test_logger.lua:10 abc
test_logger.lua:11 {1, 2, 3}
test_logger.lua:12 {a = 1, b = 2}
test_logger.lua:13 test 123 abc
OOP
local A = extends(Object)
function A.initialize(self)
self.counter = 0
end
function A.plus_one(self)
self.counter = self.counter + 1
end
local a = A.new()
assert_equal(0, a.counter)
a.plus_one()
assert_equal(1, a.counter)
Extensions
String, Table, Number, Date extensions. see TestCases.
Moai Extensions
luacat has also included moacat, for Moai http://getmoai.com/ extensions. see MoacatTestCases.
Feedback
- Subscribe to google groups http://groups.google.com/group/luacat
Related Skills
node-connect
354.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
