summaryrefslogtreecommitdiff
path: root/test/fiddle
diff options
context:
space:
mode:
authorSutou Kouhei <kou@clear-code.com>2020-12-25 06:01:12 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-05-18 12:48:40 +0900
commitb2de5999d88d81310b3c9f0c1f14451d7eca8e6e (patch)
tree99475ef28aaf965624efc8021c586e27428b9a9f /test/fiddle
parent212d836cd72742dcdf44187e0cebd7caed26bb41 (diff)
[ruby/fiddle] closure: accept symbol as type
https://github.com/ruby/fiddle/commit/dc2da6633e
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4506
Diffstat (limited to 'test/fiddle')
-rw-r--r--test/fiddle/test_closure.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/fiddle/test_closure.rb b/test/fiddle/test_closure.rb
index 2de0660725..6ccd3859f5 100644
--- a/test/fiddle/test_closure.rb
+++ b/test/fiddle/test_closure.rb
@@ -20,6 +20,18 @@ module Fiddle
end
end
+ def test_type_symbol
+ closure = Closure.new(:int, [:void])
+ assert_equal([
+ TYPE_INT,
+ [TYPE_VOID],
+ ],
+ [
+ closure.instance_variable_get(:@ctype),
+ closure.instance_variable_get(:@args),
+ ])
+ end
+
def test_call
closure = Class.new(Closure) {
def call