2016-04-15 21:00:13 -04:00
|
|
|
# frozen_string_literal: false
|
|
|
|
require 'test/unit'
|
|
|
|
require "-test-/struct"
|
|
|
|
|
|
|
|
class Bug::Struct::Test_Duplicate < Test::Unit::TestCase
|
2019-11-09 07:12:29 -05:00
|
|
|
def test_new_duplicate
|
2016-04-15 21:00:13 -04:00
|
|
|
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
|
|
|
|
|
2019-11-09 07:12:29 -05:00
|
|
|
def test_new_duplicate_under
|
2016-04-15 21:00:13 -04:00
|
|
|
bug12291 = '[ruby-core:74971] [Bug #12291]'
|
|
|
|
assert_raise_with_message(ArgumentError, /duplicate member/, bug12291) {
|
|
|
|
Bug::Struct.new_duplicate_under("x", "a")
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|