Skip to content

Commit

Permalink
#225 #172 fix type assertion inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed May 22, 2021
1 parent ef74c54 commit 19ccdef
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/language/ravi_tests1.ravi
Original file line number Diff line number Diff line change
Expand Up @@ -2050,6 +2050,43 @@ do
end
print 'Test 100 OK'

do
local function x(a, b)
local z : integer[] = { a, b }
return z
end
assert(pcall(x, 1, 2.0))
assert(not pcall(x, 1.5, 2))
assert(not pcall(x, '1.5', 2))
assert(not pcall(x, false, 2))
assert(not pcall(x, nil, 2))
compile(x)
assert(pcall(x, 1, 2.0))
assert(not pcall(x, 1.5, 2))
assert(not pcall(x, '1.5', 2))
assert(not pcall(x, false, 2))
assert(not pcall(x, nil, 2))
end
print 'Test 101 OK'

do
local function x(a, b)
local z : number[] = { a, b }
return z
end
assert(pcall(x, 42, 2.2))
assert(not pcall(x, '1.5', 2))
assert(not pcall(x, false, 2))
assert(not pcall(x, nil, 2))
compile(x)
assert(pcall(x, 42, 2.2))
assert(not pcall(x, '1.5', 2))
assert(not pcall(x, false, 2))
assert(not pcall(x, nil, 2))
end
print 'Test 102 OK'


for k,v in pairs(opcodes_coverage)
do
print(k, v)
Expand Down

0 comments on commit 19ccdef

Please sign in to comment.