From 4da36ccd43875e900c33447bdd4422376c583ce2 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Tue, 14 Mar 2023 14:52:38 +0800 Subject: [PATCH 1/3] Update workflow's Ruby matrix --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 49a9a3b..4b192de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,14 +11,14 @@ jobs: name: build (${{ matrix.ruby }} / ${{ matrix.os }}) strategy: matrix: - ruby: [ head, '3.0', '2.7' ] + ruby: ['2.7', '3.0', '3.1', '3.2', 'head'] os: [ ubuntu-latest, macos-latest, windows-latest ] exclude: - { os: windows-latest, ruby: head } include: - { os: windows-latest, ruby: mingw } - { os: windows-latest, ruby: mswin } - - { os: ubuntu-latest, ruby: 'jruby-9.3', bundle: 'bundle exec' } + - { os: ubuntu-latest, ruby: 'jruby-head', bundle: 'bundle exec' } runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 From f7bde31ca978ad3e05cafedbe9e1da5cb9d6e2c5 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Tue, 14 Mar 2023 14:59:59 +0800 Subject: [PATCH 2/3] Skip certain tests for JRuby --- test/test_pp.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_pp.rb b/test/test_pp.rb index 4fcb8df..a3e661a 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -173,11 +173,12 @@ def test_anonymous end def test_withinspect + omit if RUBY_ENGINE == "jruby" a = [] a << HasInspect.new(a) assert_equal("[]\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 @@ def test_hash 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 From 09dae9612920216e2daa48aa8d6fa17401ab12de Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Tue, 14 Mar 2023 15:29:41 +0800 Subject: [PATCH 3/3] Remove patch added for Ruby 2.6/JRuby 9.3 --- test/test_pp.rb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/test_pp.rb b/test/test_pp.rb index a3e661a..bb2299a 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -5,15 +5,6 @@ require 'test/unit' require 'ruby2_keywords' -# 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) - bind(obj).call(*args, &block) - end - end -end - module PPTestModule class PPTest < Test::Unit::TestCase