From 4342fc763039b712c1f8b11ed4750886efba2aac Mon Sep 17 00:00:00 2001 From: Dibyendu Majumdar Date: Sun, 14 Feb 2021 21:08:22 +0000 Subject: [PATCH] issue #210 #209 tests --- tests/language/ravi_tests1.ravi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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)