@ -47,6 +47,11 @@ function test.register()
test.error_raised ( function ( )
test.error_raised ( function ( )
bc : register ( " register3 " , 12 )
bc : register ( " register3 " , 12 )
end , " already registered " )
end , " already registered " )
bc : register ( " register4 " , function ( ) end )
test.error_raised ( function ( )
bc : register ( " register4 " , function ( ) end )
end , " already registered " )
end
end
function test . register_batch ( )
function test . register_batch ( )
@ -143,13 +148,18 @@ function test.call_verb()
end )
end )
bc : finalize ( )
bc : finalize ( )
bc : call ( " call1 " , 1 , 2 )
local ret = bc : call ( " call1 " , 1 , 2 )
test.equal ( 3 , flag1 , " call failed " )
test.equal ( 3 , flag1 , " call failed " )
test.equal ( 1 , flag2 , " call failed " )
test.equal ( 1 , flag2 , " call failed " )
test.equal ( true , ret , " call not attempted " )
bc : call ( " call1 " , 10 , 10 )
local ret = bc : call ( " call1 " , 10 , 10 )
test.equal ( 20 , flag1 , " call failed " )
test.equal ( 20 , flag1 , " call failed " )
test.equal ( 2 , flag2 , " call failed " )
test.equal ( 2 , flag2 , " call failed " )
test.equal ( true , ret , " call not attempted " )
local ret = bc : call ( " call2 " , 1 , 2 , 3 )
test.equal ( false , ret , " call erroneously attempted " )
end
end
function test . has_iter_verbs ( )
function test . has_iter_verbs ( )