Skip to content

Remove failed tag for Array#to_h MRI tests#5495

Merged
enebo merged 1 commit intojruby:masterfrom
nomadium:untag-array-to_h-mri-test
Dec 3, 2018
Merged

Remove failed tag for Array#to_h MRI tests#5495
enebo merged 1 commit intojruby:masterfrom
nomadium:untag-array-to_h-mri-test

Conversation

@nomadium
Copy link
Contributor

@nomadium nomadium commented Dec 3, 2018

I couldn't find anything wrong with those assertions, they seem to be passing since a long time ago.

def test_to_h
kvp = Object.new
def kvp.to_ary
[:obtained, :via_to_ary]
end
array = [
[:key, :value],
kvp,
]
assert_equal({key: :value, obtained: :via_to_ary}, array.to_h)
e = assert_raise(TypeError) {
[[:first_one, :ok], :not_ok].to_h
}
assert_equal "wrong element type Symbol at 1 (expected array)", e.message
array = [eval("class C\u{1f5ff}; self; end").new]
assert_raise_with_message(TypeError, /C\u{1f5ff}/) {array.to_h}
e = assert_raise(ArgumentError) {
[[:first_one, :ok], [1, 2], [:not_ok]].to_h
}
assert_equal "wrong array length at 2 (expected 2, was 1)", e.message
end

@enebo enebo added this to the JRuby 9.2.5.0 milestone Dec 3, 2018
@enebo enebo merged commit 2f0a6d2 into jruby:master Dec 3, 2018
@nomadium nomadium deleted the untag-array-to_h-mri-test branch December 4, 2018 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants