Add type checks for function calls
This commit is contained in:
@@ -23,6 +23,12 @@ notop = function(a) return not a end
|
|||||||
checkallpass('notop',{somenumber})
|
checkallpass('notop',{somenumber})
|
||||||
checkallerrors('notop',{notanumber},'attempt to perform arithmetic on')
|
checkallerrors('notop',{notanumber},'attempt to perform arithmetic on')
|
||||||
|
|
||||||
|
-- function call
|
||||||
|
banner( '()' )
|
||||||
|
funcop = function(a) return a() end
|
||||||
|
checkallpass('funcop',{somefunction})
|
||||||
|
checkallerrors('funcop',{notafunction},'attempt to call')
|
||||||
|
|
||||||
-- ========= binary ops: .. + - * / % ^ == ~= <= >= < > [] . and or
|
-- ========= binary ops: .. + - * / % ^ == ~= <= >= < > [] . and or
|
||||||
banner( '..' )
|
banner( '..' )
|
||||||
concatop = function(a,b) return a..b end
|
concatop = function(a,b) return a..b end
|
||||||
@@ -140,7 +146,6 @@ banner( 'or' )
|
|||||||
orop = function(a,b) return clean(a or b) end
|
orop = function(a,b) return clean(a or b) end
|
||||||
checkallpass('orop',{anylua,anylua})
|
checkallpass('orop',{anylua,anylua})
|
||||||
|
|
||||||
|
|
||||||
-- ========= for x in y
|
-- ========= for x in y
|
||||||
banner( 'for x=a,b,c' )
|
banner( 'for x=a,b,c' )
|
||||||
forop = function(a,b,c) for x=a,b,c do end end
|
forop = function(a,b,c) for x=a,b,c do end end
|
||||||
|
|||||||
Reference in New Issue
Block a user