Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update applicable .lua files to .luau #1560

Merged
merged 5 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
- name: make cli
run: |
make -j2 config=sanitize werror=1 luau luau-analyze luau-compile # match config with tests to improve build time
./luau tests/conformance/assert.lua
./luau-analyze tests/conformance/assert.lua
./luau-compile tests/conformance/assert.lua
./luau tests/conformance/assert.luau
./luau-analyze tests/conformance/assert.luau
./luau-compile tests/conformance/assert.luau

windows:
runs-on: windows-latest
Expand Down Expand Up @@ -81,9 +81,9 @@ jobs:
shell: bash # necessary for fail-fast
run: |
cmake --build . --target Luau.Repl.CLI Luau.Analyze.CLI Luau.Compile.CLI --config Debug # match config with tests to improve build time
Debug/luau tests/conformance/assert.lua
Debug/luau-analyze tests/conformance/assert.lua
Debug/luau-compile tests/conformance/assert.lua
Debug/luau tests/conformance/assert.luau
Debug/luau-analyze tests/conformance/assert.luau
Debug/luau-compile tests/conformance/assert.luau

coverage:
runs-on: ubuntu-22.04
Expand Down
File renamed without changes.
92 changes: 46 additions & 46 deletions tests/Conformance.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,32 +645,32 @@ TEST_CASE("CodegenSupported")

TEST_CASE("Assert")
{
runConformance("assert.lua");
runConformance("assert.luau");
}

TEST_CASE("Basic")
{
runConformance("basic.lua");
runConformance("basic.luau");
}

TEST_CASE("Buffers")
{
ScopedFastFlag luauBufferBitMethods{FFlag::LuauBufferBitMethods2, true};

runConformance("buffers.lua");
runConformance("buffers.luau");
}

TEST_CASE("Math")
{
ScopedFastFlag LuauMathLerp{FFlag::LuauMathLerp, true};

runConformance("math.lua");
runConformance("math.luau");
}

TEST_CASE("Tables")
{
runConformance(
"tables.lua",
"tables.luau",
[](lua_State* L)
{
lua_pushcfunction(
Expand Down Expand Up @@ -699,101 +699,101 @@ TEST_CASE("Tables")

TEST_CASE("PatternMatch")
{
runConformance("pm.lua");
runConformance("pm.luau");
}

TEST_CASE("Sort")
{
runConformance("sort.lua");
runConformance("sort.luau");
}

TEST_CASE("Move")
{
runConformance("move.lua");
runConformance("move.luau");
}

TEST_CASE("Clear")
{
runConformance("clear.lua");
runConformance("clear.luau");
}

TEST_CASE("Strings")
{
ScopedFastFlag luauStringFormatFixC{DFFlag::LuauStringFormatFixC, true};

runConformance("strings.lua");
runConformance("strings.luau");
}

TEST_CASE("StringInterp")
{
runConformance("stringinterp.lua");
runConformance("stringinterp.luau");
}

TEST_CASE("VarArg")
{
runConformance("vararg.lua");
runConformance("vararg.luau");
}

TEST_CASE("Locals")
{
runConformance("locals.lua");
runConformance("locals.luau");
}

TEST_CASE("Literals")
{
runConformance("literals.lua");
runConformance("literals.luau");
}

TEST_CASE("Errors")
{
runConformance("errors.lua");
runConformance("errors.luau");
}

TEST_CASE("Events")
{
runConformance("events.lua");
runConformance("events.luau");
}

TEST_CASE("Constructs")
{
runConformance("constructs.lua");
runConformance("constructs.luau");
}

TEST_CASE("Closure")
{
runConformance("closure.lua");
runConformance("closure.luau");
}

TEST_CASE("Calls")
{
ScopedFastFlag LuauStackLimit{DFFlag::LuauStackLimit, true};

runConformance("calls.lua");
runConformance("calls.luau");
}

TEST_CASE("Attrib")
{
runConformance("attrib.lua");
runConformance("attrib.luau");
}

TEST_CASE("GC")
{
runConformance("gc.lua");
runConformance("gc.luau");
}

TEST_CASE("Bitwise")
{
runConformance("bitwise.lua");
runConformance("bitwise.luau");
}

TEST_CASE("UTF8")
{
runConformance("utf8.lua");
runConformance("utf8.luau");
}

TEST_CASE("Coroutine")
{
runConformance("coroutine.lua");
runConformance("coroutine.luau");
}

static int cxxthrow(lua_State* L)
Expand All @@ -810,7 +810,7 @@ TEST_CASE("PCall")
ScopedFastFlag LuauStackLimit{DFFlag::LuauStackLimit, true};

runConformance(
"pcall.lua",
"pcall.luau",
[](lua_State* L)
{
lua_pushcfunction(L, cxxthrow, "cxxthrow");
Expand All @@ -836,7 +836,7 @@ TEST_CASE("PCall")

TEST_CASE("Pack")
{
runConformance("tpack.lua");
runConformance("tpack.luau");
}

TEST_CASE("Vector")
Expand Down Expand Up @@ -881,7 +881,7 @@ TEST_CASE("Vector")
}

runConformance(
"vector.lua",
"vector.luau",
[](lua_State* L)
{
setupVectorHelpers(L);
Expand Down Expand Up @@ -915,7 +915,7 @@ TEST_CASE("VectorLibrary")
copts.optimizationLevel = 2;
}

runConformance("vector_library.lua", [](lua_State* L) {}, nullptr, nullptr, &copts);
runConformance("vector_library.luau", [](lua_State* L) {}, nullptr, nullptr, &copts);
}

static void populateRTTI(lua_State* L, Luau::TypeId type)
Expand Down Expand Up @@ -993,7 +993,7 @@ TEST_CASE("Types")
ScopedFastFlag luauMathLerp{FFlag::LuauMathLerp, true};

runConformance(
"types.lua",
"types.luau",
[](lua_State* L)
{
Luau::NullModuleResolver moduleResolver;
Expand All @@ -1018,12 +1018,12 @@ TEST_CASE("Types")

TEST_CASE("DateTime")
{
runConformance("datetime.lua");
runConformance("datetime.luau");
}

TEST_CASE("Debug")
{
runConformance("debug.lua");
runConformance("debug.luau");
}

TEST_CASE("Debugger")
Expand All @@ -1050,7 +1050,7 @@ TEST_CASE("Debugger")
copts.debugLevel = 2;

runConformance(
"debugger.lua",
"debugger.luau",
[](lua_State* L)
{
lua_Callbacks* cb = lua_callbacks(L);
Expand Down Expand Up @@ -1225,7 +1225,7 @@ TEST_CASE("NDebugGetUpValue")
copts.optimizationLevel = 0;

runConformance(
"ndebug_upvalues.lua",
"ndebug_upvalues.luau",
nullptr,
[](lua_State* L)
{
Expand Down Expand Up @@ -1456,7 +1456,7 @@ TEST_CASE("ApiIter")

TEST_CASE("ApiCalls")
{
StateRef globalState = runConformance("apicalls.lua", nullptr, nullptr, lua_newstate(limitedRealloc, nullptr));
StateRef globalState = runConformance("apicalls.luau", nullptr, nullptr, lua_newstate(limitedRealloc, nullptr));
lua_State* L = globalState.get();

// lua_call
Expand Down Expand Up @@ -1783,7 +1783,7 @@ TEST_CASE("ExceptionObject")
return ExceptionResult{false, ""};
};

StateRef globalState = runConformance("exceptions.lua", nullptr, nullptr, lua_newstate(limitedRealloc, nullptr));
StateRef globalState = runConformance("exceptions.luau", nullptr, nullptr, lua_newstate(limitedRealloc, nullptr));
lua_State* L = globalState.get();

{
Expand Down Expand Up @@ -1822,7 +1822,7 @@ TEST_CASE("ExceptionObject")

TEST_CASE("IfElseExpression")
{
runConformance("ifelseexpr.lua");
runConformance("ifelseexpr.luau");
}

// Optionally returns debug info for the first Luau stack frame that is encountered on the callstack.
Expand Down Expand Up @@ -1860,7 +1860,7 @@ TEST_CASE("TagMethodError")
auto yieldCallback = [](lua_State* L) {};

runConformance(
"tmerror.lua",
"tmerror.luau",
[](lua_State* L)
{
auto* cb = lua_callbacks(L);
Expand Down Expand Up @@ -1898,7 +1898,7 @@ TEST_CASE("Coverage")
copts.coverageLevel = 2;

runConformance(
"coverage.lua",
"coverage.luau",
[](lua_State* L)
{
lua_pushcfunction(
Expand Down Expand Up @@ -1952,7 +1952,7 @@ TEST_CASE("Coverage")

TEST_CASE("StringConversion")
{
runConformance("strconv.lua");
runConformance("strconv.luau");
}

TEST_CASE("GCDump")
Expand Down Expand Up @@ -2065,7 +2065,7 @@ TEST_CASE("Interrupt")

static int index;

StateRef globalState = runConformance("interrupt.lua", nullptr, nullptr, nullptr, &copts);
StateRef globalState = runConformance("interrupt.luau", nullptr, nullptr, nullptr, &copts);

lua_State* L = globalState.get();

Expand Down Expand Up @@ -2366,7 +2366,7 @@ TEST_CASE("DebugApi")

TEST_CASE("Iter")
{
runConformance("iter.lua");
runConformance("iter.luau");
}

const int kInt64Tag = 1;
Expand Down Expand Up @@ -2395,7 +2395,7 @@ static void pushInt64(lua_State* L, int64_t value)
TEST_CASE("Userdata")
{
runConformance(
"userdata.lua",
"userdata.luau",
[](lua_State* L)
{
// create metatable with all the metamethods
Expand Down Expand Up @@ -2617,7 +2617,7 @@ TEST_CASE("Userdata")

TEST_CASE("SafeEnv")
{
runConformance("safeenv.lua");
runConformance("safeenv.luau");
}

TEST_CASE("Native")
Expand All @@ -2639,7 +2639,7 @@ TEST_CASE("Native")
}

runConformance(
"native.lua",
"native.luau",
[](lua_State* L)
{
setupNativeHelpers(L);
Expand All @@ -2654,7 +2654,7 @@ TEST_CASE("NativeTypeAnnotations")
return;

runConformance(
"native_types.lua",
"native_types.luau",
[](lua_State* L)
{
setupNativeHelpers(L);
Expand Down Expand Up @@ -2717,7 +2717,7 @@ TEST_CASE("NativeUserdata")
}

runConformance(
"native_userdata.lua",
"native_userdata.luau",
[](lua_State* L)
{
Luau::CodeGen::setUserdataRemapper(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ assert(foo(1, 2, 3) == 2)
assert(concat(pcall(function () end)) == "true")
assert(concat(pcall(function () return nil end)) == "true,nil")
assert(concat(pcall(function () return 1,2,3 end)) == "true,1,2,3")
assert(concat(pcall(function () error("oops") end)) == "false,basic.lua:39: oops")
assert(concat(pcall(function () error("oops") end)) == "false,basic.luau:39: oops")

-- assignments
assert((function() local a = 1 a = 2 return a end)() == 2)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function foo ()
error("foo")
end

local fooerr = "closure.lua:284: foo"
local fooerr = "closure.luau:284: foo"

function goo() foo() end
x = coroutine.wrap(goo)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading