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

Update applicable .lua files to .luau #1560

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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-20.04 # needed for clang++-10 to avoid gcov compatibility issues
Expand Down
File renamed without changes.
94 changes: 46 additions & 48 deletions tests/Conformance.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,30 +644,30 @@ TEST_CASE("CodegenSupported")

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

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

TEST_CASE("Buffers")
{
runConformance("buffers.lua");
runConformance("buffers.luau");
}

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

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

TEST_CASE("Tables")
{
runConformance(
"tables.lua",
"tables.luau",
[](lua_State* L)
{
lua_pushcfunction(
Expand Down Expand Up @@ -696,99 +696,99 @@ 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")
{
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 @@ -805,7 +805,7 @@ TEST_CASE("PCall")
ScopedFastFlag LuauStackLimit{DFFlag::LuauStackLimit, true};

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

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

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

runConformance(
"vector.lua",
"vector.luau",
[](lua_State* L)
{
setupVectorHelpers(L);
Expand Down Expand Up @@ -911,9 +911,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 @@ -990,7 +988,7 @@ TEST_CASE("Types")
ScopedFastFlag luauVectorDefinitions{FFlag::LuauVectorDefinitions, true};

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

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

TEST_CASE("Debug")
{
ScopedFastFlag luauDebugInfoInvArgLeftovers{DFFlag::LuauDebugInfoInvArgLeftovers, true};

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

TEST_CASE("Debugger")
Expand All @@ -1049,7 +1047,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 @@ -1224,7 +1222,7 @@ TEST_CASE("NDebugGetUpValue")
copts.optimizationLevel = 0;

runConformance(
"ndebug_upvalues.lua",
"ndebug_upvalues.luau",
nullptr,
[](lua_State* L)
{
Expand Down Expand Up @@ -1436,7 +1434,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 @@ -1739,7 +1737,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 @@ -1778,7 +1776,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 @@ -1816,7 +1814,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 @@ -1854,7 +1852,7 @@ TEST_CASE("Coverage")
copts.coverageLevel = 2;

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

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

TEST_CASE("GCDump")
Expand Down Expand Up @@ -2021,7 +2019,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 @@ -2322,7 +2320,7 @@ TEST_CASE("DebugApi")

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

const int kInt64Tag = 1;
Expand Down Expand Up @@ -2351,7 +2349,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 @@ -2573,7 +2571,7 @@ TEST_CASE("Userdata")

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

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

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

runConformance(
"native_types.lua",
"native_types.luau",
[](lua_State* L)
{
setupNativeHelpers(L);
Expand Down Expand Up @@ -2671,7 +2669,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
Loading