Skip to content

Commit

Permalink
Add tests to cover missing lines in code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Feb 5, 2021
1 parent d06984c commit 3464918
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/03-typechecker_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,12 @@ it("late deduction", function()
assert.ast_type_equals([[
local i: integer
local a: auto = nilptr or &i
local b: auto = &i and nilptr
]],[[
local i: integer
local a: *integer = nilptr or &i
local b: *integer = &i and nilptr
]])
assert.ast_type_equals([[
local a = 1_integer
Expand Down Expand Up @@ -1868,6 +1871,9 @@ it("side effects detection", function()
end
## assert(f.type.sideeffect == true)
local a: [4]integer = {f(1), f(2)}
local u: union{x: integer, y:number} = {x=f(1)}
local function f(x: integer) <nosideeffect>
X = x
return x
Expand Down

0 comments on commit 3464918

Please sign in to comment.