diff --git a/tests/language/ravi_tests1.ravi b/tests/language/ravi_tests1.ravi index 7cbe50b..e03c53d 100644 --- a/tests/language/ravi_tests1.ravi +++ b/tests/language/ravi_tests1.ravi @@ -1792,6 +1792,24 @@ compile(x) x() print 'Test 83 OK' +-- Test that ~ applied to non integer result in any type +-- issue #209 +function x(x:number) + return (~x)+1 +end +check(x, 'TOFLT', 'BNOT', 'ADD', 'RETURN', 'RETURN') +assert(x(1.0) == -1) +compile(x) +assert(x(1.0) == -1) +print 'Test 84 OK' + +-- Test that #() applied to non integer type produces any type +-- issue #210 +function x(x:integer[]) + return #(x[1])+1 +end +check(x, 'TOIARRAY', 'IARRAY_GET', 'LEN', 'ADD', 'RETURN', 'RETURN') +print 'Test 85 OK' for k,v in pairs(opcodes_coverage)