summaryrefslogtreecommitdiff
path: root/jni/ruby/test/-ext-/struct
diff options
context:
space:
mode:
Diffstat (limited to 'jni/ruby/test/-ext-/struct')
-rw-r--r--jni/ruby/test/-ext-/struct/test_member.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/jni/ruby/test/-ext-/struct/test_member.rb b/jni/ruby/test/-ext-/struct/test_member.rb
new file mode 100644
index 0000000..18e9808
--- /dev/null
+++ b/jni/ruby/test/-ext-/struct/test_member.rb
@@ -0,0 +1,15 @@
+require 'test/unit'
+require "-test-/struct"
+
+class Bug::Struct::Test_Member < Test::Unit::TestCase
+ S = Bug::Struct.new(:a)
+
+ def test_member_get
+ s = S.new(1)
+ assert_equal(1, s.get(:a))
+ assert_raise_with_message(NameError, /is not a struct member/) {s.get(:b)}
+ EnvUtil.with_default_external(Encoding::UTF_8) do
+ assert_raise_with_message(NameError, /\u{3042}/) {s.get(:"\u{3042}")}
+ end
+ end
+end