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:
17
src/test/resources/test-rom/spec/programs/shell_spec.lua
Normal file
17
src/test/resources/test-rom/spec/programs/shell_spec.lua
Normal 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)
|
||||
Reference in New Issue
Block a user