Skip to content

Commit

Permalink
enable more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CapsAdmin committed Apr 2, 2024
1 parent c1e04b5 commit c9ac347
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions test/nattlua/analyzer/if.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,34 @@ analyze[[
if b then attest.equal(a, 2) else attest.equal(a, 1) end
]]
analyze[[
local x: 1 | "1"
local y = type(x) == "number"
if y then
attest.equal(x, 1)
else
attest.equal(x, "1")
end
]]
analyze[[
local x: 1 | "1"
local y = type(x) ~= "number"
if y then
attest.equal(x, "1")
else
attest.equal(x, 1)
end
]]
analyze[[
local x: 1 | "1"
local t = "number"
local y = type(x) ~= t
if y then
attest.equal(x, "1")
else
attest.equal(x, 1)
end
]]

if false then
pending[[
Expand All @@ -1708,32 +1736,4 @@ if false then
attest.equal<|x, 0 .. 10|>
end
]]
pending[[
local x: 1 | "1"
local y = type(x) == "number"
if y then
attest.equal(x, 1)
else
attest.equal(x, "1")
end
]]
pending[[
local x: 1 | "1"
local y = type(x) ~= "number"
if y then
attest.equal(x, "1")
else
attest.equal(x, 1)
end
]]
pending[[
local x: 1 | "1"
local t = "number"
local y = type(x) ~= t
if y then
attest.equal(x, "1")
else
attest.equal(x, 1)
end
]]
end

0 comments on commit c9ac347

Please sign in to comment.