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

Endless ranges crash mutant #1026

Closed
dgollahon opened this issue Aug 24, 2020 · 5 comments · Fixed by #1027
Closed

Endless ranges crash mutant #1026

dgollahon opened this issue Aug 24, 2020 · 5 comments · Fixed by #1027
Assignees
Labels

Comments

@dgollahon
Copy link
Collaborator

Simple reproduction case I tried:

class Test
  def self.slice_after(array, index)
    array[index..]
  end
end

Reproduction spec:

RSpec.describe Test do
  it 'works' do
    expect(described_class.slice_after([1,2], 1)).to eql([2])
  end
end

Executing mutant --use rspec Test produces a long trace ending in

1: from /Users/gollahon/.rvm/gems/ruby-2.6.6/gems/mutant-0.9.9/lib/mutant/mutator/node.rb:42:in mutate_child' /Users/gollahon/.rvm/gems/ruby-2.6.6/gems/mutant-0.9.9/lib/mutant/mutator.rb:18:in mutate': undefined method `type' for nil:NilClass (NoMethodError)

Versions
mutant-rspec version: 0.9.9
unparser version: 0.4.7

@mbj
Copy link
Owner

mbj commented Aug 24, 2020

@dgollahon thanks for the report. This indicates I need to find more code bases to hook up to mutants self test in generation only mode to assert syntax coverage.

I think I should also hook up all code snippets from parser to mutants generator test suite.

@mbj mbj self-assigned this Aug 24, 2020
@mbj mbj added the bug label Aug 24, 2020
@dgollahon
Copy link
Collaborator Author

I think I should also hook up all code snippets from parser to mutants generator test suite.

Yeah, I think that would be a great idea.

@mbj
Copy link
Owner

mbj commented Aug 24, 2020

@chaubunhtha you are good? Seems you post random one word comments to this repository for no reason.

Unless you start to explain yourself, I've to block you assuming you are just here to spam.

mbj added a commit that referenced this issue Aug 25, 2020
mbj added a commit that referenced this issue Aug 25, 2020
@mbj mbj closed this as completed in #1027 Aug 25, 2020
@mbj
Copy link
Owner

mbj commented Aug 25, 2020

@dgollahon fix for this issue was released in 0.9.10.

@dgollahon
Copy link
Collaborator Author

@mbj, thanks!

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

Successfully merging a pull request may close this issue.

2 participants