Skip to content

Commit

Permalink
tests: add regression test to function call check crash
Browse files Browse the repository at this point in the history
Add another regression test to a bug fixed in
f97625d

Co-Authored-By: Victor Ilchev <[email protected]>
  • Loading branch information
hishamhm and V1K1NGbg committed Jul 26, 2024
1 parent 3811391 commit 334b453
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/call/function_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,15 @@ describe("function calls", function()
]], {
{ y = 2, msg = "wrong number of arguments (given 0, expects at least 1 and at most 4)" },
}))

it("with insufficient arguments (regression test)", util.check_type_error([[
local function a(f: (function(): any), ...: any): (function():any)
return function(...): (function():any)
return f(a, ...)
end
end
]], {
{ y = 3, msg = "wrong number of arguments (given 2, expects 0)" },
}))
end)
end)

0 comments on commit 334b453

Please sign in to comment.