1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-01 06:03:00 +00:00

Set the arg table within shell.run

This makes us a little more compatible with Lua
This commit is contained in:
SquidDev
2019-05-24 18:42:19 +01:00
parent 68bf3a71dc
commit d661cfa88b
2 changed files with 22 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
describe("The shell", function()
describe("shell.run", function()
it("sets the arguments", function()
local handle = fs.open("test-files/out.txt", "w")
handle.writeLine("_G.__arg = arg")
handle.close()
shell.run("/test-files/out.txt", "arg1", "arg2")
fs.delete("test-files/out.txt")
local args = _G.__arg
_G.__arg = nil
expect(args):same { [0] = "/test-files/out.txt", "arg1", "arg2" }
end)
end)
end)