mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
da2e0721b1
* 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
22 lines
685 B
Ruby
22 lines
685 B
Ruby
# 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
|