mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-03-04 02:28:13 +00:00
That's it, I'm adding pre-commit hooks
This commit is contained in:
parent
abbc46877b
commit
74dae4ec17
@ -7,7 +7,7 @@ describe("Coroutines", function()
|
|||||||
--- Run a function in a coroutine, "echoing" the yielded value back as the resumption value.
|
--- Run a function in a coroutine, "echoing" the yielded value back as the resumption value.
|
||||||
local function coroutine_echo(f)
|
local function coroutine_echo(f)
|
||||||
local co = coroutine.create(f)
|
local co = coroutine.create(f)
|
||||||
local result = {n = 0}
|
local result = { n = 0 }
|
||||||
while coroutine.status(co) ~= "dead" do
|
while coroutine.status(co) ~= "dead" do
|
||||||
result = assert_resume(coroutine.resume(co, table.unpack(result, 1, result.n)))
|
result = assert_resume(coroutine.resume(co, table.unpack(result, 1, result.n)))
|
||||||
end
|
end
|
||||||
@ -148,7 +148,7 @@ describe("Coroutines", function()
|
|||||||
expect(y):eq(b)
|
expect(y):eq(b)
|
||||||
|
|
||||||
return a.x < b.x
|
return a.x < b.x
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
local function create(val) return setmetatable({ x = val }, meta) end
|
local function create(val) return setmetatable({ x = val }, meta) end
|
||||||
|
@ -2,7 +2,7 @@ describe("The VM", function()
|
|||||||
it("allows unpacking a large number of values", function()
|
it("allows unpacking a large number of values", function()
|
||||||
-- We don't allow arbitrarily many values, half a meg is probably fine.
|
-- We don't allow arbitrarily many values, half a meg is probably fine.
|
||||||
-- I don't actually have any numbers on this - maybe we do need more?
|
-- I don't actually have any numbers on this - maybe we do need more?
|
||||||
local len = 2^19
|
local len = 2 ^ 19
|
||||||
local tbl = { (" "):rep(len):byte(1, -1) }
|
local tbl = { (" "):rep(len):byte(1, -1) }
|
||||||
expect(#tbl):eq(len)
|
expect(#tbl):eq(len)
|
||||||
end)
|
end)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user