mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 05:21:49 +00:00
Merge pull request #847 from MihailRis/client-side-tests
client-side `--script`, `--test` support (part 1)
This commit is contained in:
commit
4295af15cc
55 changed files with 1660 additions and 590 deletions
|
|
@ -23,6 +23,10 @@ function file.parent(path)
|
|||
return dir
|
||||
end
|
||||
|
||||
function file.remove_ext(path)
|
||||
return string.format("%s/%s", file.parent(path), file.stem(path))
|
||||
end
|
||||
|
||||
function file.path(path)
|
||||
local pos = path:find(':')
|
||||
return path:sub(pos + 1)
|
||||
|
|
|
|||
|
|
@ -59,11 +59,7 @@ end
|
|||
|
||||
function table.extend(t1, t2)
|
||||
for i, v in pairs(t2) do
|
||||
if type(i) == "number" then
|
||||
t1[#t1 + 1] = v
|
||||
else
|
||||
t1[i] = v
|
||||
end
|
||||
t1[i] = v
|
||||
end
|
||||
|
||||
return t1
|
||||
|
|
@ -201,3 +197,11 @@ function table.tostring(t)
|
|||
end
|
||||
return s..']'
|
||||
end
|
||||
|
||||
function table.keys(t)
|
||||
local keys = {}
|
||||
for key, _ in pairs(t) do
|
||||
table.insert(keys, key)
|
||||
end
|
||||
return keys
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue