repo stringclasses 341
values | file_path stringlengths 29 173 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 2 1.66M | tokens int64 2 598k |
|---|---|---|---|---|---|
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/globals/coroutine.luau | luau | .luau | -- Coroutines should return true, ret values OR false, error
local function pass()
coroutine.yield(1, 2, 3)
coroutine.yield(4, 5, 6)
end
local function fail()
error("Error message")
end
local thread1 = coroutine.create(pass)
local t10, t11, t12, t13 = coroutine.resume(thread1)
assert(t10 == true, "Coroutine resum... | 722 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/globals/error.luau | luau | .luau | local errValue = newproxy(false)
local success, result = pcall(function()
error({
Inner = errValue,
})
end)
assert(not success, "Pcall succeeded when erorred")
assert(result ~= nil, "Pcall did not return error")
assert(type(result) == "table", "Pcall error value should have been a table")
assert(result.Inner ~=... | 109 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/globals/pcall.luau | luau | .luau | local net = require("@lune/net")
local task = require("@lune/task")
local PORT = 9090 -- NOTE: This must be different from
-- net tests to let them run in parallel with this file
local function test(f, ...)
local success, message = pcall(f, ...)
assert(not success, "Function did not throw an error")
assert(
type... | 217 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/globals/type.luau | luau | .luau | local task = require("@lune/task")
local function f() end
local thread1 = coroutine.create(f)
local thread2 = task.spawn(f)
local thread3 = task.defer(f)
local thread4 = task.delay(0, f)
assert(type(thread1) == "thread", "Calling type() did not return 'thread' after coroutine.create")
assert(type(thread2) == "thread... | 141 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/globals/typeof.luau | luau | .luau | -- NOTE: luau-lsp warns without this for the roblox types below
--!nolint UnknownType
local task = require("@lune/task")
local function f() end
local thread1 = coroutine.create(f)
local thread2 = task.spawn(f)
local thread3 = task.defer(f)
local thread4 = task.delay(0, f)
assert(
typeof(thread1) == "thread",
"Cal... | 302 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/globals/warn.luau | luau | .luau | assert(warn ~= nil, "Missing 'warn' global")
assert(
type(warn) == "function",
string.format("Global 'warn' should be a function, got '%s'", tostring(type(warn)))
)
| 45 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/luau/compile.luau | luau | .luau | local luau = require("@lune/luau")
local EMPTY_LUAU_CODE_BLOCK = "do end"
local BROKEN_LUAU_CODE_BLOCK = "do"
assert(type(luau.compile) == "function", "expected `luau.compile` to be a function")
assert(
type(luau.compile(EMPTY_LUAU_CODE_BLOCK)) == "string",
"expected `luau.compile` to return bytecode string"
)
lo... | 138 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/luau/load.luau | luau | .luau | local luau = require("@lune/luau")
local RETURN_VALUE = 1
local EMPTY_LUAU_CODE_BLOCK = "do end"
local RETURN_LUAU_CODE_BLOCK = "return " .. tostring(RETURN_VALUE)
local CUSTOM_SOURCE_BLOCK_NAME = "test"
assert(type(luau.load) == "function", "expected `luau.compile` to be a function")
assert(
type(luau.load(EMPTY... | 990 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/luau/options.luau | luau | .luau | local luau = require("@lune/luau")
local EMPTY_LUAU_CODE_BLOCK = "do end"
local MIN_OPTION_VALUE = 0
local MAX_OPTION_VALUE = 2
local OPTION_NAMES = {
"optimizationLevel",
"coverageLevel",
"debugLevel",
}
for _, optionName in OPTION_NAMES do
-- In range should work
for optionValue = MIN_OPTION_VALUE, MAX_OPTION... | 344 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/luau/safeenv.luau | luau | .luau | local luau = require("@lune/luau")
local TEST_SCRIPT = [[
local start = os.clock()
local x
for i = 1, 1e6 do
x = math.sqrt(i)
end
local finish = os.clock()
return finish - start
]]
local TEST_BYTECODE = luau.compile(TEST_SCRIPT, {
optimizationLevel = 2,
coverageLevel = 0,
debugLeve... | 486 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/net/request/codes.luau | luau | .luau | local util = require("./util")
local pass, fail = util.pass, util.fail
pass("GET", "https://httpbingo.org/status/200", "Request status code - 200")
fail("GET", "https://httpbingo.org/status/400", "Request status code - 400")
fail("GET", "https://httpbingo.org/status/500", "Request status code - 500")
| 87 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/net/request/https.luau | luau | .luau | local task = require("@lune/task")
local util = require("./util")
local pass = util.pass
-- These are some public APIs that have, or most likely have, different
-- certificate authorities (CAs), plus are both free to use and stable.
-- This should be enough to ensure that rustls is configured correctly.
local servers... | 186 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/net/request/methods.luau | luau | .luau | local util = require("./util")
local pass = util.pass
-- stylua: ignore start
pass("GET", "https://httpbingo.org/get", "Request method - GET")
pass("POST", "https://httpbingo.org/post", "Request method - POST")
pass("PATCH", "https://httpbingo.org/patch", "Request method - PATCH")
pass("PUT", "https://h... | 125 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/net/request/redirect.luau | luau | .luau | local util = require("./util")
local pass = util.pass
pass("GET", "https://httpbingo.org/absolute-redirect/3", "Redirect 3 times")
| 37 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/net/request/user_agent.luau | luau | .luau | local net = require("@lune/net")
local serde = require("@lune/serde")
local runtime, version = table.unpack(_VERSION:split(" "))
local expectedUserAgent = runtime:lower() .. "/" .. version
local userAgent: string =
serde.decode("json", net.request("https://www.whatsmyua.info/api/v1/ua").body)[1].ua.rawUa
assert(use... | 103 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/net/socket/basic.luau | luau | .luau | local net = require("@lune/net")
-- We're going to use Discord's WebSocket gateway server for testing
local socket = net.socket("wss://gateway.discord.gg/?v=10&encoding=json")
assert(type(socket.next) == "function", "next must be a function")
assert(type(socket.send) == "function", "send must be a function")
assert(t... | 295 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/net/socket/wss.luau | luau | .luau | local net = require("@lune/net")
local task = require("@lune/task")
-- We're going to use Discord's WebSocket gateway server
-- for testing wss - it does not require auth, and this test
-- only exists to ensure wss (WebSockets with TLS) works correctly
local socket = net.socket("wss://gateway.discord.gg/?v=10&encoding... | 209 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/net/socket/wss_rw.luau | luau | .luau | local net = require("@lune/net")
local process = require("@lune/process")
local stdio = require("@lune/stdio")
local task = require("@lune/task")
-- We're going to use Discord's WebSocket gateway server
-- for testing that we can both read from a stream,
-- as well as write to the same stream concurrently
local socket... | 270 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/net/tcp/info.luau | luau | .luau | local net = require("@lune/net")
local stream = net.tcp.connect("httpbingo.org", 80)
assert(type(stream.localIp) == "string", "localIp should be a string")
assert(type(stream.localPort) == "number", "localPort should be a number")
assert(type(stream.remoteIp) == "string", "remoteIp should be a string")
assert(stream.... | 226 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/net/url/decode.luau | luau | .luau | local net = require("@lune/net")
local decoded = net.urlDecode("%F0%9F%9A%80%20This%20string%20will%20be%20decoded.")
assert(decoded == "🚀 This string will be decoded.")
| 55 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/net/url/encode.luau | luau | .luau | local net = require("@lune/net")
local encoded = net.urlEncode("🚀 This string will be encoded.")
assert(encoded == "%F0%9F%9A%80%20This%20string%20will%20be%20encoded.")
| 55 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/args.luau | luau | .luau | local process = require("@lune/process")
assert(type(process.args) == "table", "Process args should be a plain table")
assert(#process.args > 0, "No process arguments found")
assert(process.args[1] == "Foo", "Invalid first argument to process")
assert(process.args[2] == "Bar", "Invalid second argument to process")
... | 200 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/create/kill.luau | luau | .luau | local process = require("@lune/process")
local expected = "Hello, world!"
local catChild = process.create("cat")
catChild.stdin:write(expected)
catChild:kill()
local catStatus = catChild:status()
local catStdout = catChild.stdout:readToEnd()
assert(catStatus.code == 9, "Child process should have an exit code of 9 (S... | 140 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/create/non_blocking.luau | luau | .luau | local process = require("@lune/process")
local childThread = coroutine.create(process.create)
local ok, err = coroutine.resume(childThread, "echo", { "hello, world" })
assert(ok, err)
assert(
coroutine.status(childThread) == "dead",
"Child process should not yield the thread it is created on"
)
| 71 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/create/status.luau | luau | .luau | local process = require("@lune/process")
local testCode = math.random(0, 255)
local testOk = testCode == 0
local exitChild = process.create("exit", { tostring(testCode) }, { shell = true })
local exitStatus = exitChild:status()
assert(type(exitStatus) == "table", "Child status should be a table")
assert(type(exitSta... | 216 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/create/stream.luau | luau | .luau | local process = require("@lune/process")
local expected = "hello, world"
-- Stdout test
local catChild = process.create("cat")
catChild.stdin:write(expected)
catChild.stdin:close()
local catOutput = catChild.stdout:read(#expected)
-- Make sure the child exits
catChild:status()
assert(
expected == catOutput,
"Fai... | 257 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/cwd.luau | luau | .luau | local process = require("@lune/process")
assert(process.cwd ~= nil, "Process cwd is missing")
assert(type(process.cwd) == "string", "Process cwd is not a string")
assert(#process.cwd > 0, "Process cwd is an empty string")
if process.os == "windows" then
assert(string.sub(process.cwd, -1) == "\\", "Process cwd does... | 108 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/env.luau | luau | .luau | local process = require("@lune/process")
assert(type(process.env) == "table", "Process env should be a plain table")
local randomKey = string.format("LUNE_TEST_%d", math.random(1, 999_999))
assert(process.env[randomKey] == nil, "Unset variable returned a non-nil value")
process.env[randomKey] = "abc"
assert(process... | 119 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/exec/async.luau | luau | .luau | local process = require("@lune/process")
local stdio = require("@lune/stdio")
local task = require("@lune/task")
local IS_WINDOWS = process.os == "windows"
-- Executing a command should not block any lua thread(s)
local SLEEP_DURATION = 1 / 4
local SLEEP_SAMPLES = 2
local thread2 = task.delay(
if IS_WINDOWS then 3... | 341 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/exec/basic.luau | luau | .luau | local process = require("@lune/process")
local stdio = require("@lune/stdio")
local task = require("@lune/task")
-- Executing a command should work, with options
local thread = task.delay(1, function()
stdio.ewrite("Spawning a process should take a reasonable amount of time\n")
task.wait(1)
process.exit(1)
end)
l... | 208 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/exec/cwd.luau | luau | .luau | local process = require("@lune/process")
local IS_WINDOWS = process.os == "windows"
local pwdCommand = if IS_WINDOWS then "cmd" else "pwd"
local pwdArgs = if IS_WINDOWS then { "/c", "cd" } else {}
-- Make sure the cwd option actually uses the directory we want
local rootPwd = process.exec(pwdCommand, pwdArgs, {
cwd... | 461 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/exec/no_panic.luau | luau | .luau | local process = require("@lune/process")
-- Executing a non existent command as a child process
-- should not panic, but should error
local success = pcall(process.exec, "someProgramThatDoesNotExist")
assert(not success, "Spawned a non-existent program")
| 58 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/exec/shell.luau | luau | .luau | local process = require("@lune/process")
local IS_WINDOWS = process.os == "windows"
-- Default shell should be /bin/sh on unix and powershell on Windows,
-- note that powershell needs slightly different command flags for ls
local shellResult = process.exec("ls", {
if IS_WINDOWS then "-Force" else "-a",
}, {
shell ... | 169 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/exec/stdio.luau | luau | .luau | local process = require("@lune/process")
local IS_WINDOWS = process.os == "windows"
-- Inheriting stdio & environment variables should work
local echoMessage = "Hello from child process!"
local echoResult = process.exec("echo", {
if IS_WINDOWS then '"$Env:TEST_VAR"' else '"$TEST_VAR"',
}, {
env = { TEST_VAR = echo... | 161 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/process/exit.luau | luau | .luau | local fs = require("@lune/fs")
local process = require("@lune/process")
local task = require("@lune/task")
local function assert(condition, err)
if not condition then
task.spawn(error, err)
process.exit(0)
end
end
local path = process.cwd .. "asdfghjkl"
assert(fs.isDir(path), "Process should exit with success"... | 116 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/regex/general.luau | luau | .luau | --!nocheck
local regex = require("@lune/regex")
local re = regex.new("[0-9]+")
assert(re:isMatch("look, a number: 1241425") == true)
local mtch = re:find("1337 wow")
assert(mtch ~= nil)
assert(mtch.start == 1)
assert(mtch.finish == 4)
assert(mtch.len == 4)
assert(mtch.text == "1337")
assert(#mtch == mtch.len)
re =... | 416 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/regex/metamethods.luau | luau | .luau | --!nolint
local regex = require("@lune/regex")
local re = regex.new("[0-9]+")
assert(tostring(re) == "[0-9]+")
assert(typeof(re) == "Regex")
local mtch = re:find("1337 wow")
assert(tostring(mtch) == "1337")
assert(typeof(mtch) == "RegexMatch")
local re2 = regex.new("([0-9]+) ([0-9]+) wow! ([0-9]+) ([0-9]+)")
local ... | 157 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/regex/replace.luau | luau | .luau | local regex = require("@lune/regex")
-- Tests taken from the Regex crate
local function replace(
name: string,
pattern: string,
find: string,
replace: string,
expected: string
)
local re = regex.new(pattern)
local replaced = re:replace(find, replace)
if replaced ~= expected then
error(`test '{name}' did not... | 555 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/modules/init.luau | luau | .luau | return {
Foo = "Bar",
Hello = "World",
}
| 15 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/aliases.luau | luau | .luau | local module = require("@tests/require/tests/module")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
local module2 = require("@requ... | 145 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/async.luau | luau | .luau | local module = require("./modules/async")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
module = require("./modules/async")
assert... | 102 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/async_concurrent.luau | luau | .luau | local task = require("@lune/task")
local module1
local module2
task.defer(function()
module2 = require("./modules/async")
end)
task.spawn(function()
module1 = require("./modules/async")
end)
task.wait(1)
assert(type(module1) == "table", "Required module1 did not return a table")
assert(module1.Foo == "Bar", "Req... | 184 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/async_sequential.luau | luau | .luau | local task = require("@lune/task")
local module1 = require("./modules/async")
local module2 = require("./modules/async")
task.wait(1)
assert(type(module1) == "table", "Required module1 did not return a table")
assert(module1.Foo == "Bar", "Required module1 did not contain correct values")
assert(module1.Hello == "Wo... | 166 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/builtins.luau | luau | .luau | local fs = require("@lune/fs")
local net = require("@lune/net")
local process = require("@lune/process")
local stdio = require("@lune/stdio")
local task = require("@lune/task")
assert(type(fs.move) == "function")
assert(type(net.request) == "function")
assert(type(process.cwd) == "string")
assert(type(stdio.format("")... | 161 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/children.luau | luau | .luau | local module = require("./modules/module")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
module = require("./modules/module")
asse... | 103 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/init_files.luau | luau | .luau | local module = require("./modules")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
module = require("./modules/modules")
assert(typ... | 178 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/invalid.luau | luau | .luau | local function test(path: string)
local success, message = pcall(function()
local _ = require("./" .. path) :: any
end)
if success then
error(string.format("Invalid require at path '%s' succeeded", path))
else
message = tostring(message)
if string.find(message, string.format("%s", path)) == nil then
erro... | 167 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/modules/async.luau | luau | .luau | local task = require("@lune/task")
task.wait(0.25)
return {
Foo = "Bar",
Hello = "World",
}
| 31 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/modules/nested.luau | luau | .luau | return require("./modules/module")
| 6 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/modules/self_alias/init.luau | luau | .luau | local inner = require("@self/module")
local outer = require("./module")
assert(type(outer) == "table", "Outer module is not a table")
assert(type(inner) == "table", "Inner module is not a table")
assert(outer.Foo == inner.Foo, "Outer and inner modules have different Foo values")
assert(inner.Hello == outer.Hello, "Ou... | 90 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/multi_ext.luau | luau | .luau | require("./multi.ext.file")
| 6 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/nested.luau | luau | .luau | local module = require("./modules/nested")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
module = require("./modules/nested")
asse... | 102 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/parents.luau | luau | .luau | local module = require("../modules/module")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
return true
| 62 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/siblings.luau | luau | .luau | local module = require("./module")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
require("./children")
require("./parents")
requi... | 74 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/state.luau | luau | .luau | -- the idea of this test is that state_module stores some state in one of its local
-- variable
local state_module = require("./state_module")
-- we confirm that without anything happening, the initial value is what we expect
assert(state_module.state == 10)
-- this second file also requires state_module and calls a ... | 112 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/state_module.luau | luau | .luau | local M = {}
M.state = 10
function M.set_state(n: number)
M.state = n
end
return M
| 28 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/require/tests/state_second.luau | luau | .luau | local state_module = require("./state_module")
state_module.set_state(11)
return {}
| 18 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Axes.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Axes = roblox.Axes
local Enum = roblox.Enum
-- Constructors & properties
Axes.new()
Axes.new(Enum.Axis.X)
Axes.new(Enum.Axis.X, Enum.NormalId.Top)
assert(not pcall(function()
return Axes.new(false)
end))
assert(not pcall(function()
return Axes.new({})
end))
asser... | 299 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/BrickColor.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local BrickColor = roblox.BrickColor
local Color3 = roblox.Color3
-- Constructors & properties
BrickColor.new(1)
BrickColor.new("Medium stone grey")
assert(not pcall(function()
return BrickColor.new(false)
end))
assert(not pcall(function()
return BrickColor.new({})
end... | 240 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/CFrame.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local CFrame = roblox.CFrame
local Vector3 = roblox.Vector3
local Instance = roblox.Instance
local COMPONENT_NAMES =
{ "X", "Y", "Z", "R00", "R01", "R02", "R10", "R11", "R12", "R20", "R21", "R22" }
local function formatCFrame(cf)
local rot = Vector3.new(cf:ToOrientation... | 1,635 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Color3.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Color3 = roblox.Color3
-- Constructors & properties
Color3.new()
Color3.new(0)
Color3.new(0, 0)
Color3.new(0, 0, 0)
Color3.new(0 / 0, 0 / 0)
Color3.new(0 / 0, 0 / 0, 0 / 0)
assert(not pcall(function()
return Color3.new(false)
end))
assert(not pcall(function()
ret... | 849 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/ColorSequence.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Color3 = roblox.Color3
local ColorSequence = roblox.ColorSequence
local ColorSequenceKeypoint = roblox.ColorSequenceKeypoint
-- Constructors & properties
ColorSequence.new(Color3.new())
ColorSequence.new(Color3.new(), Color3.new())
local sequence = ColorSequence.new... | 324 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/ColorSequenceKeypoint.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Color3 = roblox.Color3
local ColorSequenceKeypoint = roblox.ColorSequenceKeypoint
-- Constructors & properties
ColorSequenceKeypoint.new(0, Color3.new())
ColorSequenceKeypoint.new(1, Color3.new())
assert(not pcall(function()
return ColorSequenceKeypoint.new()
end)... | 241 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Content.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Content = roblox.Content
local Instance = roblox.Instance
local Enum = roblox.Enum
assert(Content.none, "Content.none did not exist")
assert(
Content.none.SourceType == Enum.ContentSourceType.None,
"Content.none's SourceType was wrong"
)
assert(Content.none.Uri == ... | 555 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Enum.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Enum = roblox.Enum
-- Constructors & properties
assert(tostring(Enum) == "Enum")
assert(tostring(Enum.KeyCode) == "Enum.KeyCode")
assert(tostring(Enum.KeyCode.X) == "Enum.KeyCode.X")
-- NOTE: We use the axis enum here since it is unlikely
-- any more will be added ... | 215 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Faces.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Faces = roblox.Faces
local Enum = roblox.Enum
-- Constructors & properties
Faces.new()
Faces.new(Enum.NormalId.Top)
Faces.new(Enum.NormalId.Left, Enum.NormalId.Top)
assert(not pcall(function()
return Faces.new(false)
end))
assert(not pcall(function()
return Faces... | 286 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Font.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Enum = roblox.Enum
local Font = roblox.Font
-- Constructors
Font.new("")
Font.new("", Enum.FontWeight.Bold)
Font.new("", Enum.FontWeight.Bold, Enum.FontStyle.Italic)
assert(not pcall(function()
Font.new("", Enum.FontStyle.Italic, Enum.FontWeight.Bold)
end))
assert... | 371 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/NumberRange.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local NumberRange = roblox.NumberRange
-- Constructors & properties
NumberRange.new(0)
NumberRange.new(0, 0)
assert(not pcall(function()
return NumberRange.new()
end))
assert(not pcall(function()
return NumberRange.new(false)
end))
assert(not pcall(function()
return N... | 202 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/NumberSequence.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local NumberSequence = roblox.NumberSequence
local NumberSequenceKeypoint = roblox.NumberSequenceKeypoint
-- Constructors & properties
NumberSequence.new(0)
NumberSequence.new(0, 0)
-- Two-value form must build a ramp, not drop the second argument
local ramp = NumberSequ... | 414 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/NumberSequenceKeypoint.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local NumberSequenceKeypoint = roblox.NumberSequenceKeypoint
-- Constructors & properties
NumberSequenceKeypoint.new(0, 0)
NumberSequenceKeypoint.new(1, 0)
NumberSequenceKeypoint.new(0.5, 0.5, 0.5)
assert(not pcall(function()
return NumberSequenceKeypoint.new()
end))
as... | 275 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/PhysicalProperties.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local PhysicalProperties = roblox.PhysicalProperties
local Enum = roblox.Enum
-- Constructors & properties
PhysicalProperties.new(Enum.Material.SmoothPlastic)
PhysicalProperties.new(0, 0, 0)
PhysicalProperties.new(0, 0, 0, 0, 0)
assert(not pcall(function()
return Physic... | 683 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Ray.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Ray = roblox.Ray
local Vector3 = roblox.Vector3
local origin = Vector3.zero
local direction = Vector3.zAxis * 10
-- Constructors & properties
Ray.new(origin, direction)
assert(not pcall(function()
return Ray.new(false)
end))
assert(not pcall(function()
return Ra... | 333 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Rect.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Vector2 = roblox.Vector2
local Rect = roblox.Rect
-- Constructors & properties
Rect.new()
Rect.new(0)
Rect.new(0, 0)
Rect.new(0, 0, 0)
Rect.new(0, 0, 0, 0)
Rect.new(0 / 0, 0, 0 / 0, 0)
Rect.new(Vector2.zero)
Rect.new(Vector2.zero, Vector2.zero)
assert(not pcall(fu... | 501 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Region3.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Region3 = roblox.Region3
local Vector3 = roblox.Vector3
local CFrame = roblox.CFrame
local min = Vector3.new(-2, -2, -2)
local max = Vector3.new(2, 2, 2)
-- Constructors & properties
Region3.new(min, max)
assert(not pcall(function()
return Region3.new(false)
end)... | 407 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Region3int16.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Region3int16 = roblox.Region3int16
local Vector3int16 = roblox.Vector3int16
local Vector3 = roblox.Vector3
local min = Vector3int16.new(0, 0, 0)
local max = Vector3int16.new(2, 2, 2)
-- Constructors & properties
Region3int16.new(min, max)
assert(not pcall(function... | 259 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/UDim.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local UDim = roblox.UDim
-- Constructors & properties
UDim.new()
UDim.new(0)
UDim.new(0, 0)
UDim.new(0 / 0, 0)
assert(not pcall(function()
return UDim.new(false)
end))
assert(not pcall(function()
return UDim.new("", "")
end))
assert(not pcall(function()
return UDim.ne... | 202 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/UDim2.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local UDim = roblox.UDim
local UDim2 = roblox.UDim2
-- Constructors & properties
UDim2.new()
UDim2.new(0)
UDim2.new(0, 0)
UDim2.new(0, 0, 0)
UDim2.new(0, 0, 0, 0)
UDim2.new(0 / 0, 0, 0 / 0, 0)
assert(not pcall(function()
return UDim2.new(false)
end))
assert(not pcall(fu... | 695 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/UniqueId.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local UniqueId = roblox.UniqueId
UniqueId.new()
UniqueId.fromString("1234567890123456")
UniqueId.fromString(buffer.fromstring("1234567890123456"))
assert(not pcall(function()
return UniqueId.fromString(false)
end))
assert(not pcall(function()
return UniqueId.fromString(... | 358 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Vector2.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Vector2 = roblox.Vector2
-- Constructors & properties
Vector2.new()
Vector2.new(0)
Vector2.new(0, 0)
Vector2.new(0 / 0, 0 / 0)
assert(not pcall(function()
return Vector2.new(false)
end))
assert(not pcall(function()
return Vector2.new("", "")
end))
assert(not pcal... | 672 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Vector2int16.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Vector2int16 = roblox.Vector2int16
-- Constructors & properties
Vector2int16.new()
Vector2int16.new(0)
Vector2int16.new(0, 0)
assert(not pcall(function()
return Vector2int16.new(999_999, 999_999)
end))
assert(not pcall(function()
return Vector2int16.new(false)
en... | 400 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Vector3.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Vector3 = roblox.Vector3
-- Constructors & properties
Vector3.new()
Vector3.new(0)
Vector3.new(0, 0)
Vector3.new(0, 0, 0)
Vector3.new(0 / 0, 0 / 0)
Vector3.new(0 / 0, 0 / 0, 0 / 0)
assert(not pcall(function()
return Vector3.new(false)
end))
assert(not pcall(functi... | 789 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/datatypes/Vector3int16.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Vector3int16 = roblox.Vector3int16
-- Constructors & properties
Vector3int16.new()
Vector3int16.new(0)
Vector3int16.new(0, 0)
Vector3int16.new(0, 0, 0)
assert(not pcall(function()
return Vector3int16.new(999_999, 999_999, 999_999)
end))
assert(not pcall(function()... | 499 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/files/deserializeModel.luau | luau | .luau | local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
local modelDirs = {}
for _, dirName in fs.readDir("tests/roblox/rbx-test-files/places") do
table.insert(modelDirs, "tests/roblox/rbx-test-files/places/" .. dirName)
end
for _, modelDir in modelDirs do
local modelFileBinary = fs.readFile(modelDir ... | 178 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/files/deserializePlace.luau | luau | .luau | local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
local placeDirs = {}
for _, dirName in fs.readDir("tests/roblox/rbx-test-files/places") do
table.insert(placeDirs, "tests/roblox/rbx-test-files/places/" .. dirName)
end
for _, placeDir in placeDirs do
local placeFileBinary = fs.readFile(placeDir ... | 174 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/files/multiDom.luau | luau | .luau | local fs = require("@lune/fs")
local roblox = require("@lune/roblox") :: any
-- Issue #356: deserializing the same place twice must produce two fully
-- independent doms. Their instances share referents (and UniqueIds), so an
-- implementation that merged everything into one dom would confuse them.
local bytes = fs.r... | 424 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/files/serializeModel.luau | luau | .luau | local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
local Instance = roblox.Instance
-- Smoke tests
do
local instances = {
Instance.new("Model"),
Instance.new("Part"),
}
local modelAsBinary = roblox.serializeModel(instances)
local modelAsXml = roblox.serializeModel(instances, true)
fs.writ... | 464 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/files/serializePlace.luau | luau | .luau | local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
local Instance = roblox.Instance
-- Smoke tests
do
local game = Instance.new("DataModel")
local workspace = game:GetService("Workspace")
local model = Instance.new("Model")
local part = Instance.new("Part")
part.Parent = model
model.Parent ... | 358 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/attributes.luau | luau | .luau | local fs = require("@lune/fs")
local roblox = require("@lune/roblox") :: any
local BrickColor = roblox.BrickColor
local CFrame = roblox.CFrame
local Color3 = roblox.Color3
local ColorSequence = roblox.ColorSequence
local ColorSequenceKeypoint = roblox.ColorSequenceKeypoint
local Font = roblox.Font
local NumberRange = ... | 1,062 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/classes/DataModel.luau | luau | .luau | local roblox = require("@lune/roblox")
local Instance = roblox.Instance
local game = Instance.new("DataModel")
-- Workspace should always exist as a "Workspace" property, or be created when accessed
local workspace = (game :: any).Workspace
assert(workspace ~= nil)
assert(workspace:IsA("Workspace"))
assert(workspace... | 200 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/classes/Terrain.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Instance = roblox.Instance
local Color3 = roblox.Color3
local Enum = roblox.Enum
local game = Instance.new("DataModel")
local workspace = game:GetService("Workspace")
local terrain = (workspace :: any).Terrain
assert(terrain:GetMaterialColor(Enum.Material.Grass) == ... | 136 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/classes/Workspace.luau | luau | .luau | local roblox = require("@lune/roblox")
local Instance = roblox.Instance
local game = Instance.new("DataModel")
local workspace = game:GetService("Workspace")
-- Terrain should always exist as a "Terrain" property, or be created when accessed
local terrain = (workspace :: any).Terrain
assert(terrain ~= nil)
assert(te... | 144 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/custom/classes.luau | luau | .luau | local roblox = require("@lune/roblox")
-- Custom classes that rbx-dom does not know about should be implementable (#125)
local successBefore = pcall(function()
roblox.Instance.new("MyCustomClass")
end)
assert(not successBefore, "Creating an unimplemented custom class should error")
roblox.registerClass("MyCustomCla... | 720 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/custom/methods.luau | luau | .luau | local roblox = require("@lune/roblox")
local inst = roblox.Instance.new("Instance") :: any
local part = roblox.Instance.new("Part") :: any
-- Basic sanity checks for callbacks
local success = pcall(function()
inst:Wat()
end)
assert(not success, "Nonexistent methods should error")
roblox.implementMethod("Instance",... | 338 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/custom/properties.luau | luau | .luau | local roblox = require("@lune/roblox")
local inst = roblox.Instance.new("Instance") :: any
local part = roblox.Instance.new("Part") :: any
-- Basic sanity checks for callbacks
local success = pcall(function()
local _ = inst.Wat
end)
assert(not success, "Nonexistent properties should error")
roblox.implementPropert... | 443 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/custom/services.luau | luau | .luau | local roblox = require("@lune/roblox")
-- Services that rbx-dom does not know about (such as FileSystemService, which
-- only exists in roblox-cli builds) should be implementable (#125)
local game = roblox.Instance.new("DataModel") :: any
local successBefore = pcall(function()
game:GetService("FileSystemService")
e... | 401 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/identity.luau | luau | .luau | local roblox = require("@lune/roblox") :: any
local Instance = roblox.Instance
-- Issue #242: an instance reached via two different paths must be the *same*
-- userdata, so that it behaves correctly as a table key and with rawequal.
-- Via .Parent
local obj = Instance.new("Folder")
local child = Instance.new("Folder"... | 431 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/methods/ClearAllChildren.luau | luau | .luau | local roblox = require("@lune/roblox")
local Instance = roblox.Instance
local root = Instance.new("Model")
local child1 = Instance.new("Part")
local child2 = Instance.new("Part")
child1.Parent = root
child2.Parent = root
assert(#root:GetChildren() == 2)
assert(root:GetChildren()[1] == child1)
assert(root:GetChildren... | 143 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/methods/Clone.luau | luau | .luau | local roblox = require("@lune/roblox")
local Instance = roblox.Instance
local root = Instance.new("Model")
local child = Instance.new("Part")
local objValue1 = Instance.new("ObjectValue")
local objValue2 = Instance.new("ObjectValue")
objValue1.Name = "ObjectValue1"
objValue2.Name = "ObjectValue2"
(objValue1 :: any).V... | 231 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/methods/Destroy.luau | luau | .luau | local roblox = require("@lune/roblox")
local Instance = roblox.Instance
local root = Instance.new("Folder")
local child = Instance.new("Model")
local descendant = Instance.new("Part")
child.Parent = root
descendant.Parent = child
root:Destroy()
assert(not pcall(function()
return root.Name
end))
assert(not root.Pa... | 109 |
revvy02/rodeo | revvy02-rodeo-1c8b6e8/tests-new/adapters/lune/roblox/instance/methods/FindFirstAncestor.luau | luau | .luau | local roblox = require("@lune/roblox")
local Instance = roblox.Instance
local root = Instance.new("Folder")
local child = Instance.new("Model")
local nested = Instance.new("Tool")
local descendant = Instance.new("Part")
descendant.Parent = nested
nested.Parent = child
child.Parent = root
assert(descendant:FindFirstA... | 123 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.