diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a2b5f105..acc5d58d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 diff --git a/fuzz/basic.lua b/fuzz/basic.luau similarity index 100% rename from fuzz/basic.lua rename to fuzz/basic.luau diff --git a/tests/Conformance.test.cpp b/tests/Conformance.test.cpp index c0e81371d..58f2aadf8 100644 --- a/tests/Conformance.test.cpp +++ b/tests/Conformance.test.cpp @@ -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( @@ -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) @@ -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"); @@ -831,7 +831,7 @@ TEST_CASE("PCall") TEST_CASE("Pack") { - runConformance("tpack.lua"); + runConformance("tpack.luau"); } TEST_CASE("Vector") @@ -876,7 +876,7 @@ TEST_CASE("Vector") } runConformance( - "vector.lua", + "vector.luau", [](lua_State* L) { setupVectorHelpers(L); @@ -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) @@ -990,7 +988,7 @@ TEST_CASE("Types") ScopedFastFlag luauVectorDefinitions{FFlag::LuauVectorDefinitions, true}; runConformance( - "types.lua", + "types.luau", [](lua_State* L) { Luau::NullModuleResolver moduleResolver; @@ -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") @@ -1049,7 +1047,7 @@ TEST_CASE("Debugger") copts.debugLevel = 2; runConformance( - "debugger.lua", + "debugger.luau", [](lua_State* L) { lua_Callbacks* cb = lua_callbacks(L); @@ -1224,7 +1222,7 @@ TEST_CASE("NDebugGetUpValue") copts.optimizationLevel = 0; runConformance( - "ndebug_upvalues.lua", + "ndebug_upvalues.luau", nullptr, [](lua_State* L) { @@ -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 @@ -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(); { @@ -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. @@ -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); @@ -1854,7 +1852,7 @@ TEST_CASE("Coverage") copts.coverageLevel = 2; runConformance( - "coverage.lua", + "coverage.luau", [](lua_State* L) { lua_pushcfunction( @@ -1908,7 +1906,7 @@ TEST_CASE("Coverage") TEST_CASE("StringConversion") { - runConformance("strconv.lua"); + runConformance("strconv.luau"); } TEST_CASE("GCDump") @@ -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(); @@ -2322,7 +2320,7 @@ TEST_CASE("DebugApi") TEST_CASE("Iter") { - runConformance("iter.lua"); + runConformance("iter.luau"); } const int kInt64Tag = 1; @@ -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 @@ -2573,7 +2571,7 @@ TEST_CASE("Userdata") TEST_CASE("SafeEnv") { - runConformance("safeenv.lua"); + runConformance("safeenv.luau"); } TEST_CASE("Native") @@ -2593,7 +2591,7 @@ TEST_CASE("Native") } runConformance( - "native.lua", + "native.luau", [](lua_State* L) { setupNativeHelpers(L); @@ -2608,7 +2606,7 @@ TEST_CASE("NativeTypeAnnotations") return; runConformance( - "native_types.lua", + "native_types.luau", [](lua_State* L) { setupNativeHelpers(L); @@ -2671,7 +2669,7 @@ TEST_CASE("NativeUserdata") } runConformance( - "native_userdata.lua", + "native_userdata.luau", [](lua_State* L) { Luau::CodeGen::setUserdataRemapper( diff --git a/tests/conformance/apicalls.lua b/tests/conformance/apicalls.luau similarity index 100% rename from tests/conformance/apicalls.lua rename to tests/conformance/apicalls.luau diff --git a/tests/conformance/assert.lua b/tests/conformance/assert.luau similarity index 100% rename from tests/conformance/assert.lua rename to tests/conformance/assert.luau diff --git a/tests/conformance/attrib.lua b/tests/conformance/attrib.luau similarity index 100% rename from tests/conformance/attrib.lua rename to tests/conformance/attrib.luau diff --git a/tests/conformance/basic.lua b/tests/conformance/basic.luau similarity index 99% rename from tests/conformance/basic.lua rename to tests/conformance/basic.luau index 05d851ea9..7f382485d 100644 --- a/tests/conformance/basic.lua +++ b/tests/conformance/basic.luau @@ -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) diff --git a/tests/conformance/bitwise.lua b/tests/conformance/bitwise.luau similarity index 100% rename from tests/conformance/bitwise.lua rename to tests/conformance/bitwise.luau diff --git a/tests/conformance/buffers.lua b/tests/conformance/buffers.luau similarity index 100% rename from tests/conformance/buffers.lua rename to tests/conformance/buffers.luau diff --git a/tests/conformance/calls.lua b/tests/conformance/calls.luau similarity index 100% rename from tests/conformance/calls.lua rename to tests/conformance/calls.luau diff --git a/tests/conformance/clear.lua b/tests/conformance/clear.luau similarity index 100% rename from tests/conformance/clear.lua rename to tests/conformance/clear.luau diff --git a/tests/conformance/closure.lua b/tests/conformance/closure.luau similarity index 99% rename from tests/conformance/closure.lua rename to tests/conformance/closure.luau index 10dc322fb..fba65706e 100644 --- a/tests/conformance/closure.lua +++ b/tests/conformance/closure.luau @@ -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) diff --git a/tests/conformance/constructs.lua b/tests/conformance/constructs.luau similarity index 100% rename from tests/conformance/constructs.lua rename to tests/conformance/constructs.luau diff --git a/tests/conformance/coroutine.lua b/tests/conformance/coroutine.luau similarity index 100% rename from tests/conformance/coroutine.lua rename to tests/conformance/coroutine.luau diff --git a/tests/conformance/coverage.lua b/tests/conformance/coverage.luau similarity index 100% rename from tests/conformance/coverage.lua rename to tests/conformance/coverage.luau diff --git a/tests/conformance/datetime.lua b/tests/conformance/datetime.luau similarity index 100% rename from tests/conformance/datetime.lua rename to tests/conformance/datetime.luau diff --git a/tests/conformance/debug.lua b/tests/conformance/debug.luau similarity index 96% rename from tests/conformance/debug.lua rename to tests/conformance/debug.luau index 9fa02e274..89d43480f 100644 --- a/tests/conformance/debug.lua +++ b/tests/conformance/debug.luau @@ -35,7 +35,7 @@ end local co2 = coroutine.create(halp) coroutine.resume(co2, 0 / 0, 42) -assert(debug.traceback(co2) == "debug.lua:31 function halp\n") +assert(debug.traceback(co2) == "debug.luau:31 function halp\n") assert(debug.info(co2, 0, "l") == 31) assert(debug.info(co2, 0, "f") == halp) @@ -64,7 +64,7 @@ assert(baz(1, "n") == "baz") assert(baz(2, "n") == "") -- main/anonymous assert(baz(3, "n") == nil) assert(baz(0, "s") == "[C]") -assert(baz(1, "s") == "debug.lua") +assert(baz(1, "s") == "debug.luau") assert(baz(0, "l") == -1) assert(baz(1, "l") > 42) assert(baz(0, "f") == debug.info) @@ -87,7 +87,7 @@ end assert(#(quux(1, "nlsf")) == 4) assert(quux(1, "nlsf")[1] == "quux") assert(quux(1, "nlsf")[2] > 64) -assert(quux(1, "nlsf")[3] == "debug.lua") +assert(quux(1, "nlsf")[3] == "debug.luau") assert(quux(1, "nlsf")[4] == quux) -- info arity diff --git a/tests/conformance/debugger.lua b/tests/conformance/debugger.luau similarity index 100% rename from tests/conformance/debugger.lua rename to tests/conformance/debugger.luau diff --git a/tests/conformance/errors.lua b/tests/conformance/errors.luau similarity index 100% rename from tests/conformance/errors.lua rename to tests/conformance/errors.luau diff --git a/tests/conformance/events.lua b/tests/conformance/events.luau similarity index 100% rename from tests/conformance/events.lua rename to tests/conformance/events.luau diff --git a/tests/conformance/exceptions.lua b/tests/conformance/exceptions.luau similarity index 100% rename from tests/conformance/exceptions.lua rename to tests/conformance/exceptions.luau diff --git a/tests/conformance/gc.lua b/tests/conformance/gc.luau similarity index 100% rename from tests/conformance/gc.lua rename to tests/conformance/gc.luau diff --git a/tests/conformance/ifelseexpr.lua b/tests/conformance/ifelseexpr.luau similarity index 100% rename from tests/conformance/ifelseexpr.lua rename to tests/conformance/ifelseexpr.luau diff --git a/tests/conformance/interrupt.lua b/tests/conformance/interrupt.luau similarity index 100% rename from tests/conformance/interrupt.lua rename to tests/conformance/interrupt.luau diff --git a/tests/conformance/iter.lua b/tests/conformance/iter.luau similarity index 100% rename from tests/conformance/iter.lua rename to tests/conformance/iter.luau diff --git a/tests/conformance/literals.lua b/tests/conformance/literals.luau similarity index 100% rename from tests/conformance/literals.lua rename to tests/conformance/literals.luau diff --git a/tests/conformance/locals.lua b/tests/conformance/locals.luau similarity index 100% rename from tests/conformance/locals.lua rename to tests/conformance/locals.luau diff --git a/tests/conformance/math.lua b/tests/conformance/math.luau similarity index 100% rename from tests/conformance/math.lua rename to tests/conformance/math.luau diff --git a/tests/conformance/move.lua b/tests/conformance/move.luau similarity index 100% rename from tests/conformance/move.lua rename to tests/conformance/move.luau diff --git a/tests/conformance/native.lua b/tests/conformance/native.luau similarity index 100% rename from tests/conformance/native.lua rename to tests/conformance/native.luau diff --git a/tests/conformance/native_types.lua b/tests/conformance/native_types.luau similarity index 100% rename from tests/conformance/native_types.lua rename to tests/conformance/native_types.luau diff --git a/tests/conformance/native_userdata.lua b/tests/conformance/native_userdata.luau similarity index 100% rename from tests/conformance/native_userdata.lua rename to tests/conformance/native_userdata.luau diff --git a/tests/conformance/ndebug_upvalues.lua b/tests/conformance/ndebug_upvalues.luau similarity index 100% rename from tests/conformance/ndebug_upvalues.lua rename to tests/conformance/ndebug_upvalues.luau diff --git a/tests/conformance/pcall.lua b/tests/conformance/pcall.luau similarity index 88% rename from tests/conformance/pcall.lua rename to tests/conformance/pcall.luau index 265c397bd..abb242d39 100644 --- a/tests/conformance/pcall.lua +++ b/tests/conformance/pcall.luau @@ -77,9 +77,9 @@ checkresults({ "yield", "return", true, 1, 2, 3}, colog(function() return pcall( checkresults({ "yield", 1, "yield", 2, "return", true, true, 3}, colog(function() return pcall(function() coroutine.yield(1) return pcall(function() coroutine.yield(2) return 3 end) end) end)) -- error after yield tests -checkresults({ "yield", "return", false, "pcall.lua:80: foo" }, colog(function() return pcall(function() coroutine.yield() error("foo") end) end)) -checkresults({ "yield", "yield", "return", true, false, "pcall.lua:81: foo" }, colog(function() return pcall(function() coroutine.yield() return pcall(function() coroutine.yield() error("foo") end) end) end)) -checkresults({ "yield", "yield", "return", false, "pcall.lua:82: bar" }, colog(function() return pcall(function() coroutine.yield() pcall(function() coroutine.yield() error("foo") end) error("bar") end) end)) +checkresults({ "yield", "return", false, "pcall.luau:80: foo" }, colog(function() return pcall(function() coroutine.yield() error("foo") end) end)) +checkresults({ "yield", "yield", "return", true, false, "pcall.luau:81: foo" }, colog(function() return pcall(function() coroutine.yield() return pcall(function() coroutine.yield() error("foo") end) end) end)) +checkresults({ "yield", "yield", "return", false, "pcall.luau:82: bar" }, colog(function() return pcall(function() coroutine.yield() pcall(function() coroutine.yield() error("foo") end) error("bar") end) end)) -- returning lots of results (past MINSTACK limits) local res = {pcall(function() return table.unpack(table.create(100, 'a')) end)} @@ -100,15 +100,15 @@ checkresults({ true, 2 }, xpcall(function(...) return select('#', ...) end, erro checkresults({ "yield", "return", true, 42 }, colog(function() return xpcall(function() coroutine.yield() return 42 end, error) end)) -- xpcall immediate error handling -checkresults({ false, "pcall.lua:103: foo" }, xpcall(function() error("foo") end, function(err) return err end)) +checkresults({ false, "pcall.luau:103: foo" }, xpcall(function() error("foo") end, function(err) return err end)) checkresults({ false, "bar" }, xpcall(function() error("foo") end, function(err) return "bar" end)) checkresults({ false, 1 }, xpcall(function() error("foo") end, function(err) return 1, 2 end)) -checkresults({ false, "pcall.lua:106: foo\npcall.lua:106\npcall.lua:106\n" }, xpcall(function() error("foo") end, debug.traceback)) +checkresults({ false, "pcall.luau:106: foo\npcall.luau:106\npcall.luau:106\n" }, xpcall(function() error("foo") end, debug.traceback)) checkresults({ false, "error in error handling" }, xpcall(function() error("foo") end, function(err) error("bar") end)) -- xpcall error handling after yields -checkresults({ "yield", "return", false, "pcall.lua:110: foo" }, colog(function() return xpcall(function() coroutine.yield() error("foo") end, function(err) return err end) end)) -checkresults({ "yield", "return", false, "pcall.lua:111: foo\npcall.lua:111\npcall.lua:111\n" }, colog(function() return xpcall(function() coroutine.yield() error("foo") end, debug.traceback) end)) +checkresults({ "yield", "return", false, "pcall.luau:110: foo" }, colog(function() return xpcall(function() coroutine.yield() error("foo") end, function(err) return err end) end)) +checkresults({ "yield", "return", false, "pcall.luau:111: foo\npcall.luau:111\npcall.luau:111\n" }, colog(function() return xpcall(function() coroutine.yield() error("foo") end, debug.traceback) end)) -- xpcall error handling during error handling inside xpcall after yields checkresults({ "yield", "return", true, false, "error in error handling" }, colog(function() return xpcall(function() return xpcall(function() coroutine.yield() error("foo") end, function(err) error("bar") end) end, error) end)) @@ -126,7 +126,7 @@ coroutine.yield(weird) weird() end -checkresults({ false, "pcall.lua:129: cannot resume dead coroutine" }, pcall(function() for _ in coroutine.wrap(pcall), weird do end end)) +checkresults({ false, "pcall.luau:129: cannot resume dead coroutine" }, pcall(function() for _ in coroutine.wrap(pcall), weird do end end)) -- c++ exception checkresults({ false, "oops" }, pcall(cxxthrow)) diff --git a/tests/conformance/pm.lua b/tests/conformance/pm.luau similarity index 100% rename from tests/conformance/pm.lua rename to tests/conformance/pm.luau diff --git a/tests/conformance/safeenv.lua b/tests/conformance/safeenv.luau similarity index 100% rename from tests/conformance/safeenv.lua rename to tests/conformance/safeenv.luau diff --git a/tests/conformance/sort.lua b/tests/conformance/sort.luau similarity index 100% rename from tests/conformance/sort.lua rename to tests/conformance/sort.luau diff --git a/tests/conformance/strconv.lua b/tests/conformance/strconv.luau similarity index 100% rename from tests/conformance/strconv.lua rename to tests/conformance/strconv.luau diff --git a/tests/conformance/stringinterp.lua b/tests/conformance/stringinterp.luau similarity index 100% rename from tests/conformance/stringinterp.lua rename to tests/conformance/stringinterp.luau diff --git a/tests/conformance/strings.lua b/tests/conformance/strings.luau similarity index 100% rename from tests/conformance/strings.lua rename to tests/conformance/strings.luau diff --git a/tests/conformance/tables.lua b/tests/conformance/tables.luau similarity index 100% rename from tests/conformance/tables.lua rename to tests/conformance/tables.luau diff --git a/tests/conformance/tmerror.lua b/tests/conformance/tmerror.luau similarity index 100% rename from tests/conformance/tmerror.lua rename to tests/conformance/tmerror.luau diff --git a/tests/conformance/tpack.lua b/tests/conformance/tpack.luau similarity index 100% rename from tests/conformance/tpack.lua rename to tests/conformance/tpack.luau diff --git a/tests/conformance/types.lua b/tests/conformance/types.luau similarity index 100% rename from tests/conformance/types.lua rename to tests/conformance/types.luau diff --git a/tests/conformance/userdata.lua b/tests/conformance/userdata.luau similarity index 100% rename from tests/conformance/userdata.lua rename to tests/conformance/userdata.luau diff --git a/tests/conformance/utf8.lua b/tests/conformance/utf8.luau similarity index 100% rename from tests/conformance/utf8.lua rename to tests/conformance/utf8.luau diff --git a/tests/conformance/vararg.lua b/tests/conformance/vararg.luau similarity index 100% rename from tests/conformance/vararg.lua rename to tests/conformance/vararg.luau diff --git a/tests/conformance/vector.lua b/tests/conformance/vector.luau similarity index 100% rename from tests/conformance/vector.lua rename to tests/conformance/vector.luau diff --git a/tests/conformance/vector_library.lua b/tests/conformance/vector_library.luau similarity index 100% rename from tests/conformance/vector_library.lua rename to tests/conformance/vector_library.luau