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 46ff8e2 commit f1d4198
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 @@ -214,6 +214,12 @@
in [0]
end
}.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 f1d4198

Please sign in to comment.