summaryrefslogtreecommitdiff
path: root/test/dl
diff options
context:
space:
mode:
Diffstat (limited to 'test/dl')
-rw-r--r--test/dl/test_func.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/dl/test_func.rb b/test/dl/test_func.rb
index 514ed6c6c2..b1aac15dd2 100644
--- a/test/dl/test_func.rb
+++ b/test/dl/test_func.rb
@@ -15,6 +15,14 @@ module DL
assert_equal('<callback>qsort', cb.name)
end
+ def test_bind
+ f = Function.new(CFunc.new(0, TYPE_INT, 'test'), [TYPE_INT, TYPE_INT])
+ assert_nothing_raised {
+ f.bind { |x, y| x + y }
+ }
+ assert_equal 579, f.call(123, 456)
+ end
+
def test_to_i
cfunc = CFunc.new(@libc['strcpy'], TYPE_VOIDP, 'strcpy')
f = Function.new(cfunc, [TYPE_VOIDP, TYPE_VOIDP])