[ruby/psych] Use assert_same in tests where applicable

https://github.com/ruby/psych/commit/0dc25a9d6a
This commit is contained in:
Alexander Momchilov 2023-12-18 04:01:01 -05:00 committed by Hiroshi SHIBATA
parent e6fa1d62fa
commit b3598f95fa
2 changed files with 5 additions and 5 deletions

View File

@ -39,7 +39,7 @@ module Psych
rescue Psych::DisallowedClass
data = Psych.unsafe_load yml
end
assert_equal data.first.object_id, data.last.object_id
assert_same data.first, data.last
end
def test_float_references
@ -49,7 +49,7 @@ module Psych
- *name
eoyml
assert_equal data.first, data.last
assert_equal data.first.object_id, data.last.object_id
assert_same data.first, data.last
end
def test_binary_references
@ -60,7 +60,7 @@ module Psych
- *name
eoyml
assert_equal data.first, data.last
assert_equal data.first.object_id, data.last.object_id
assert_same data.first, data.last
end
def test_regexp_references
@ -70,7 +70,7 @@ module Psych
- *name
eoyml
assert_equal data.first, data.last
assert_equal data.first.object_id, data.last.object_id
assert_same data.first, data.last
end
end
end

View File

@ -319,7 +319,7 @@ description:
list = seq.to_ruby
assert_equal %w{ foo foo }, list
assert_equal list[0].object_id, list[1].object_id
assert_same list[0], list[1]
end
def test_mapping_with_str_tag