diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-16 01:00:13 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-16 01:00:13 +0000 |
commit | da2e0721b1ba94e8e786224469fe4bf7550c996a (patch) | |
tree | 6251858faae77bd6f9b9cfeaf71a5426906af6ab /test/ruby/test_struct.rb | |
parent | c746d5027d0a57ef5996b3394e7c6a2f2b96df0d (diff) | |
download | ruby-da2e0721b1ba94e8e786224469fe4bf7550c996a.tar.gz |
struct.c: unique members
* 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/trunk@54612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_struct.rb')
-rw-r--r-- | test/ruby/test_struct.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb index 38632a1981..1223d4b816 100644 --- a/test/ruby/test_struct.rb +++ b/test/ruby/test_struct.rb @@ -367,6 +367,13 @@ module TestStruct assert_nil(o.dig(:b, 0)) end + def test_new_dupilicate + bug12291 = '[ruby-core:74971] [Bug #12291]' + assert_raise_with_message(ArgumentError, /duplicate member/, bug12291) { + @Struct.new(:a, :a) + } + end + class TopStruct < Test::Unit::TestCase include TestStruct |