
9.1k Views
8 Executions
unc test (open source)
Universal Script πUploaded by 2 years ago
Please login to perform these actions:
Description
test

test

Universal Script π
Hall of Fame #7
Universal Script π

Universal Script π

Universal Script π

Universal Script π

Universal Script π

Universal Script π

Universal Script π
--[[ WARNING: Heads up! This script has not been verified by ScriptBlox. Use at your own risk! ]] local passes, fails, undefined = 0, 0, 0 local running = 0 local function getGlobal(path) local value = getfenv(0) while value ~= nil and path ~= "" do local name, nextValue = string.match(path, "^([^.]+)%.?(.*)$") value = value[name] path = nextValue end return value end local function test(name, aliases, callback) running += 1 task.s*(function() if not callback then print("βΊοΈ " .. name) elseif not getGlobal(name) then fails += 1 warn("β " .. name) else local success, message = pcall(callback) if success then passes += 1 print("β " .. name .. (message and " β’ " .. message or "")) else fails += 1 warn("β " .. name .. " failed: " .. message) end end local undefinedAliases = {} for _, alias in ipairs(aliases) do if getGlobal(alias) == nil then table.insert(undefinedAliases, alias) end end if #undefinedAliases > 0 then undefined += 1 warn("β οΈ " .. table.concat(undefinedAliases, ", ")) end running -= 1 end) end -- Header and summary print("\n") print("UNC Environment Check") print("β - Pass, β - Fail, βΊοΈ - No test, β οΈ - Missing aliases\n") task.defer(function() repeat task.wait() until running == 0 local rate = math.round(passes / (passes + fails) * 100) local outOf = passes .. " out of " .. (passes + fails) print("\n") print("UNC Summary") print("β Tested with a " .. rate .. "% success rate (" .. outOf .. ")") print("β " .. fails .. " tests failed") print("β οΈ " .. undefined .. " globals are missing aliases") end) -- Cache test("cache.invalidate", {}, function() local container = Instance.new("Folder") local part = Instance.new("Part", container) cache.inv