From fcbf63e62c627deae76c1b8cb8c0876c536ed811 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 16 Mar 2020 18:49:26 +0900 Subject: Fresh start --- jni/ruby/test/-ext-/struct/test_member.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 jni/ruby/test/-ext-/struct/test_member.rb (limited to 'jni/ruby/test/-ext-/struct/test_member.rb') 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 -- cgit v1.2.3