ruby-changes:70294
From: Charles <ko1@a...>
Date: Sat, 18 Dec 2021 09:31:09 +0900 (JST)
Subject: [ruby-changes:70294] 66ec3217df (master): [ruby/pp] Add context to bind_call and skip 2.7+ test
https://git.ruby-lang.org/ruby.git/commit/?id=66ec3217df From 66ec3217dfe92267791071acb50ac60791a7861e Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter <headius@h...> Date: Tue, 7 Dec 2021 15:10:16 -0600 Subject: [ruby/pp] Add context to bind_call and skip 2.7+ test The bind_call definition here is added primarily to support running the tests on JRuby 9.3, which only supports Ruby 2.6 features. The excluded test appears to depend on inspect behavior that changed after Ruby 2.6. With these two changes the test suite runs green on Ruby 2.6 and JRuby 9.3. https://github.com/ruby/pp/commit/892c612958 --- test/test_pp.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_pp.rb b/test/test_pp.rb index ab8f9595f48..9cef555d79f 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -5,7 +5,7 @@ require 'delegate' https://github.com/ruby/ruby/blob/trunk/test/test_pp.rb#L5 require 'test/unit' require 'ruby2_keywords' -# Define bind_call for Ruby 2.6 and earlier +# Define bind_call for Ruby 2.6 and earlier, to allow testing on JRuby 9.3 class UnboundMethod unless public_method_defined?(:bind_call) def bind_call(obj, *args, &block) @@ -168,7 +168,7 @@ class PPCycleTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_pp.rb#L168 a << HasInspect.new(a) assert_equal("[<inspect:[...]>]\n", PP.pp(a, ''.dup)) assert_equal("#{a.inspect}\n", PP.pp(a, ''.dup)) - end + end unless RUBY_VERSION < "2.7" # temporary mask to test on JRuby 9.3 (2.6 equivalent) def test_share_nil begin -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/