mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
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
This commit is contained in:
parent
c746d5027d
commit
da2e0721b1
5 changed files with 77 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue