mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-26 17:12:59 +00:00
Merge branch 'dev' of github.com:sbrl/Minetest-WorldEditAdditions into dev
This commit is contained in:
commit
8a2c26d395
1 changed files with 13 additions and 1 deletions
|
@ -23,6 +23,11 @@ metatable.__index = metatable
|
||||||
|
|
||||||
local registered_tests = {}
|
local registered_tests = {}
|
||||||
|
|
||||||
|
--- Register a test
|
||||||
|
-- @param string test_name The name of the test
|
||||||
|
-- @param table def The definition of the test
|
||||||
|
-- @return nil No return. Adds the test to local registry
|
||||||
|
-- accessable via get_registered_tests method
|
||||||
local register_test = function(test_name, def)
|
local register_test = function(test_name, def)
|
||||||
---
|
---
|
||||||
-- 1: Validation
|
-- 1: Validation
|
||||||
|
@ -53,10 +58,17 @@ end
|
||||||
local normalize_test = {}
|
local normalize_test = {}
|
||||||
normalize_test.__index = normalize_test
|
normalize_test.__index = normalize_test
|
||||||
|
|
||||||
normalize_test.__call = function(self, test_name, def)
|
--- Register a test
|
||||||
|
-- @param string test_name The name of the test
|
||||||
|
-- @param table def The definition of the test
|
||||||
|
-- @return nil No return. Adds the test to local registry
|
||||||
|
-- accessable via get_registered_tests method
|
||||||
|
normalize_test.__call = function(_self, test_name, def)
|
||||||
register_test(test_name, def)
|
register_test(test_name, def)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get all registered tests
|
||||||
|
-- @return table All registered tests
|
||||||
normalize_test.get_registered_tests = function()
|
normalize_test.get_registered_tests = function()
|
||||||
local ret = {}
|
local ret = {}
|
||||||
for k, v in pairs(registered_tests) do
|
for k, v in pairs(registered_tests) do
|
||||||
|
|
Loading…
Reference in a new issue