Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception raised when mutating pattern matching #1417

Closed
HashNotAdam opened this issue Feb 7, 2024 · 1 comment
Closed

Exception raised when mutating pattern matching #1417

HashNotAdam opened this issue Feb 7, 2024 · 1 comment
Assignees

Comments

@HashNotAdam
Copy link

Given the following code:

case some_method_call
in {result: true}
  success_thing
in {result: false, error:}
  failure_thing
end

I receive this error from mutant:

Killfork exited nonzero. Its result (if any) was ignored.
Process status:
#<Process::Status: pid 33464 exit 1>
Log messages (combined stderr and stdout):
[killfork] ...mutant-0.11.27/lib/mutant/loader.rb:30:in `eval': path_to_my_class.rb:28: syntax error, unexpected terminator, expecting literal content or tSTRING_DBEG or tSTRING_DVAR or tLABEL_END (SyntaxError)
[killfork]         in {%(): true} then
[killfork]               ^
[killfork] 
[killfork]      from ...mutant-0.11.27/lib/mutant/loader.rb:30:in `call'
[killfork]      from ...mutant-0.11.27/lib/mutant/loader.rb:19:in `call'
[killfork]      from ...mutant-0.11.27/lib/mutant/mutation.rb:67:in `insert'
[killfork]      from ...mutant-0.11.27/lib/mutant/env.rb:165:in `block in run_mutation_tests'
...

The subsequent diff looks like:

   case some_method_call
-  in {result: true} then
+  in {%(): true} then
     success_thing
   in {result: false, error:} then
     failure_thing
   end

My stack is:

  • mutant 0.11.27
  • Ruby 3.3.0
@HashNotAdam HashNotAdam changed the title Invalid syntax suggestion when pattern matching Exception raised when mutating pattern matching Feb 7, 2024
@mbj mbj self-assigned this Feb 9, 2024
mbj added a commit that referenced this issue Feb 9, 2024
@mbj mbj closed this as completed in 81c58fc Feb 9, 2024
@mbj
Copy link
Owner

mbj commented Feb 9, 2024

@HashNotAdam Thanks for the report, fixed with v0.11.28 I have just released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants