Skip to content

Commit

Permalink
Skip failing on TruffleRuby specs
Browse files Browse the repository at this point in the history
  • Loading branch information
andrykonchin committed May 9, 2024
1 parent 063da06 commit 9b26718
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions spec/language/pattern_matching_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@
end

it "does not support variable binding" do
next skip if RUBY_ENGINE == "truffleruby"

-> {
eval <<~RUBY
case [0, 1]
Expand Down Expand Up @@ -642,6 +644,7 @@ def obj.deconstruct; [0, 1] end
it "calls #deconstruct once for multiple patterns, caching the result" do
# 2.7 doesn't cache
next skip if RUBY_VERSION =~ /^2\.7\./
next skip if RUBY_ENGINE == "truffleruby"

obj = Object.new

Expand Down Expand Up @@ -722,6 +725,8 @@ def obj.deconstruct; "" end
end

it "accepts a subclass of Array from #deconstruct" do
next skip if RUBY_ENGINE == "truffleruby"

obj = Object.new
def obj.deconstruct
subarray = Class.new(Array).new(2)
Expand Down
6 changes: 5 additions & 1 deletion spec/language/ruby_pattern_matching_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,13 @@ def test_alternative_pattern
end
end
unless RUBY_ENGINE == "truffleruby"
assert_syntax_error(%q{
case 0
in a | 0
end
}, /illegal variable in alternative pattern/)
end
end
def test_var_pattern
Expand Down Expand Up @@ -1281,7 +1283,7 @@ def test_deconstruct_keys
end
# https://github.com/jruby/jruby/issues/7854
unless defined?(JRUBY_VERSION)
unless defined?(JRUBY_VERSION) || RUBY_ENGINE == "truffleruby"
assert_block do
case {}
in {}
Expand Down Expand Up @@ -1558,13 +1560,15 @@ def deconstruct
unless RUBY_VERSION =~ /^2\.7\./
def test_deconstruct_cache
unless RUBY_ENGINE == "truffleruby"
assert_block do
case CDeconstructCache.new([[0]])
in [1]
in [0]
true
end
end
end
assert_block do
case CDeconstructCache.new([[0, 1]])
Expand Down

0 comments on commit 9b26718

Please sign in to comment.