diff options
author | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-16 18:49:26 +0900 |
---|---|---|
committer | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-30 00:39:06 +0900 |
commit | fcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch) | |
tree | 64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/test/-ext-/struct |
Fresh start
Diffstat (limited to 'jni/ruby/test/-ext-/struct')
-rw-r--r-- | jni/ruby/test/-ext-/struct/test_member.rb | 15 |
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 |