Make testing framework more generic

This commit is contained in:
2025-09-25 20:00:49 -04:00
parent 057b930711
commit eb617a454f
4 changed files with 44 additions and 63 deletions
+2 -1
View File
@@ -40,7 +40,7 @@ function core.fileContainsWorkspace(fileContents: string, opts: types.opts): boo
assert(typeof(fileContents) == "string", "Expected fileContents to be of type 'string'")
assert(typeof(opts) == "table", "Expected opts to be of type 'table'")
if opts.zlibDecompressFiles or opts.zlibDecompressFilesRecursive then
local success = pcall(function() fileContents = compression.zlibDecompress(fileContents, opts.zlibDecompressFilesRecursive) end)
local success = pcall(function() fileContents = compression.zlibDecompress(fileContents, opts) end)
if not success then
stdio.write(stdio.color("yellow"))
stdio.write("Warning: Failed to decompress file with zlib. Proceeding with original contents.\n")
@@ -54,6 +54,7 @@ function core.fileContainsWorkspace(fileContents: string, opts: types.opts): boo
return core.scanForWorkspace(instances, opts.printInstanceNames)
end
-- formats the workspace detection result as a colored string
function core.formatResult(result: boolean, fileName: string): string
assert(typeof(result) == "boolean", "Expected result to be of type 'boolean'")