[ruby/pp] Skip certain tests for JRuby

https://github.com/ruby/pp/commit/f7bde31ca9
This commit is contained in:
Stan Lo 2023-03-14 14:59:59 +08:00 committed by git
parent 82995d4615
commit c9b61ec53e

View File

@ -173,11 +173,12 @@ class PPCycleTest < Test::Unit::TestCase
end
def test_withinspect
omit if RUBY_ENGINE == "jruby"
a = []
a << HasInspect.new(a)
assert_equal("[<inspect:[...]>]\n", PP.pp(a, ''.dup))
assert_equal("#{a.inspect}\n", PP.pp(a, ''.dup))
end unless RUBY_VERSION < "2.7" # temporary mask to test on JRuby 9.3 (2.6 equivalent)
end
def test_share_nil
begin
@ -197,6 +198,7 @@ class PPSingleLineTest < Test::Unit::TestCase
end
def test_hash_in_array
omit if RUBY_ENGINE == "jruby"
assert_equal("[{}]", PP.singleline_pp([->(*a){a.last.clear}.ruby2_keywords.call(a: 1)], ''.dup))
assert_equal("[{}]", PP.singleline_pp([Hash.ruby2_keywords_hash({})], ''.dup))
end