Skip to content
This repository was archived by the owner on Sep 14, 2024. It is now read-only.

Commit 6b5a2ec

Browse files
authored
Fix debugging of tests in Studio (#145)
* Fix debugging of tests in Studio Copy 'script' directly to new env to make Studio debugger happy, as it does not look into __index, because of security reasons * Make comment line shorter
1 parent 470e3da commit 6b5a2ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/TestPlan.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ function TestNode:expand()
194194
for key, value in pairs(self.environment) do
195195
callbackEnv[key] = value
196196
end
197+
-- Copy 'script' directly to new env to make Studio debugger happy.
198+
-- Studio debugger does not look into __index, because of security reasons
199+
callbackEnv.script = originalEnv.script
197200
setfenv(self.callback, callbackEnv)
198201

199202
local success, result = xpcall(self.callback, function(message)

0 commit comments

Comments
 (0)