diff options
-rw-r--r-- | test/dl/test_handle.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/dl/test_handle.rb b/test/dl/test_handle.rb index a128805521..75edb10534 100644 --- a/test/dl/test_handle.rb +++ b/test/dl/test_handle.rb @@ -23,8 +23,16 @@ module DL def test_static_sym skip "DL::Handle.sym is not supported" if /mswin|mingw/ =~ RUBY_PLATFORM - assert_not_nil DL::Handle.sym('dlopen') - assert_equal DL::Handle.sym('dlopen'), DL::Handle['dlopen'] + begin + # Linux / Darwin / FreeBSD + assert_not_nil DL::Handle.sym('dlopen') + assert_equal DL::Handle.sym('dlopen'), DL::Handle['dlopen'] + rescue + # NetBSD + require 'objspace' + assert_not_nil DL::Handle.sym('Init_objspace') + assert_equal DL::Handle.sym('Init_objspace'), DL::Handle['Init_objspace'] + end end def test_sym_closed_handle |