Skip to content

Commit 2559f9c

Browse files
committed
more prints in load
1 parent 4e435d4 commit 2559f9c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lute/std/libs/luau.luau

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ end
170170

171171
function luau.loadbypath(requirePath: path.pathlike): any
172172
local requirePathStr = if typeof(requirePath) == "string" then requirePath else path.format(requirePath)
173-
173+
print(`got script path: {requirePathStr}`)
174174
local migrationHandle = fs.open(requirePathStr, "r")
175-
175+
print(`opened file handle`)
176176
local migrationBytecode = luau.compile(fs.read(migrationHandle))
177-
177+
print(`compiled bytecode`)
178178
fs.close(migrationHandle)
179-
179+
print(`closed file handle`)
180180
return luau.load(migrationBytecode, requirePathStr)()
181181
end
182182

tests/loadbypath.test.luau

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ test.suite("Lute CLI", function(suite)
5454
check.eq(result, "Success")
5555

5656
local result = process.run({ lutePathStr, path.format(requirerPath), path.format(requireePath) })
57-
check.eq(result.stdout, "Success\n")
57+
check.neq(result.stdout:find("got script path"), nil)
58+
check.neq(result.stdout:find("opened file handle"), nil)
59+
check.neq(result.stdout:find("compiled bytecode"), nil)
60+
check.neq(result.stdout:find("closed file handle"), nil)
5861
check.eq(result.exitcode, 0)
5962

6063
-- Cleanup

0 commit comments

Comments
 (0)