-
Notifications
You must be signed in to change notification settings - Fork 177
Closed
Description
After recent update to the latest Prism we have two new failures in ruby/spec tests suite, related to a bit different warning/exception messages. So wondering if it's a known issue and 100% matching is supposed at all.
#1
it "warns if there are identical when clauses" do
-> {
eval <<~RUBY
case 1
when 2
:foo
when 2
:bar
end
RUBY
}.should complain(/warning: duplicated .when' clause with line \d+ is ignored/, verbose: true)
endPrism returns "'when' clause on line 4 duplicates 'when' clause on line 2 and is ignored"
#2
it "does not allow calculation or method calls in a pattern" do
-> {
eval <<~RUBY
case 0
in 1 + 1
true
end
RUBY
}.should raise_error(SyntaxError, /unexpected|expected a delimiter after the predicates of a `when` clause/)
endPrism returns two errors:
"expected a delimiter after the patterns of aninclause""unexpected '+', ignoring it"
CRuby returns the following error message:
syntax error, unexpected '+', expecting `then' or ';' or '\n'
in 1 + 1
^
Metadata
Metadata
Assignees
Labels
No labels