Skip to content

Commit

Permalink
New COVERAGE tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SnorlaxAssist committed Apr 4, 2024
1 parent 9c75c7b commit e5252cb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ FIU_TESTCASES {
"Conformance/utf8",
"Conformance/vararg",

// Emulated Tests
"Conformance/Emulated/Coverage",

// Instruction Specific Tests
"Conformance/Instructions/Calls",
"Conformance/Instructions/Constants",
Expand Down
23 changes: 23 additions & 0 deletions tests/Conformance/Emulated/Coverage.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--!ctx Luau

local ok, compileResult = Luau.compile([[
print("Hello World!")
]])

if not ok then
error(`Failed to compile, error: {compileResult}`)
end

local module = Fiu.luau_deserialize(compileResult)

table.insert(module.mainProto.code, 1, {
opcode = 69,
opname = "COVERAGE",
E = 0,
})

local func, _ = Fiu.luau_load(module, {print = print})

func()

OK()

0 comments on commit e5252cb

Please sign in to comment.