diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-22 06:59:00 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-22 06:59:00 +0000 |
commit | 88efadca4aea13b6c5f3cd4b39c932004d4a23e2 (patch) | |
tree | d0c6e0e0506733a3563d3c39826435f94fff1f1d /test/-ext- | |
parent | 8d9e1ca97219af43e99f8987070130914c18a584 (diff) |
merge revision(s) 54611,54612: [Backport #12291]
* struct.c (struct_make_members_list): extract making member name
list from char* va_list, with creating symbols without
intermediate IDs.
* struct.c (struct_make_members_list, rb_struct_s_def): member
names should be unique. [ruby-core:74971] [Bug #12291]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-')
-rw-r--r-- | test/-ext-/struct/test_duplicate.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/-ext-/struct/test_duplicate.rb b/test/-ext-/struct/test_duplicate.rb new file mode 100644 index 0000000000..77d61988b6 --- /dev/null +++ b/test/-ext-/struct/test_duplicate.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: false +require 'test/unit' +require "-test-/struct" + +class Bug::Struct::Test_Duplicate < Test::Unit::TestCase + def test_new_dupilicate + bug12291 = '[ruby-core:74971] [Bug #12291]' + assert_raise_with_message(ArgumentError, /duplicate member/, bug12291) { + Bug::Struct.new_duplicate(nil, "a") + } + assert_raise_with_message(ArgumentError, /duplicate member/, bug12291) { + Bug::Struct.new_duplicate("X", "a") + } + end + + def test_new_dupilicate_under + bug12291 = '[ruby-core:74971] [Bug #12291]' + assert_raise_with_message(ArgumentError, /duplicate member/, bug12291) { + Bug::Struct.new_duplicate_under("x", "a") + } + end +end |