Skip to content

Commit

Permalink
Add a case for failed Hash pattern match
Browse files Browse the repository at this point in the history
This is not tested elsewhere and was found to be broken in JRuby's
JIT in jruby/jruby#8283.
  • Loading branch information
headius committed Jun 6, 2024
1 parent 08f5600 commit 2e9b95e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions language/pattern_matching_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ def o.evaled
end
RUBY
}.should raise_error(NoMatchingPatternError, /\[0, 1\]/)

-> {
case {a: 0, b: 1}
in a: 1, b: 1
end
}.should raise_error(NoMatchingPatternError, /\{:a=>0, :b=>1\}/)
end

it "raises NoMatchingPatternError if no pattern matches and evaluates the expression only once" do
Expand Down

0 comments on commit 2e9b95e

Please sign in to comment.