Sha256: 7f42b855c20a6a014e6c999444f8c6932d1c2642e1f5b753ced79ff8ca3341c0

Contents?: true

Size: 1.97 KB

Versions: 17

Compression:

Stored size: 1.97 KB

Contents

# frozen_string_literal: true

Mutant::Meta::Example.add :if do
  source 'if condition; true; else false; end'

  singleton_mutations

  # mutation of condition
  mutation 'if !condition; true; else false; end'
  mutation 'if nil;        true; else false; end'
  mutation 'if true;       true; else false; end'
  mutation 'if false;      true; else false; end'

  # Deleted else branch
  mutation 'if condition; true end'

  # Promote if branch
  mutation 'true'

  # Promote else branch
  mutation 'false'

  # Deleted if branch resulting in unless rendering
  mutation 'unless condition; false; end'

  # Deleted if branch with promoting else branch to if branch
  mutation 'if condition; false end'

  # mutation of if body
  mutation 'if condition; false; else false; end'
  mutation 'if condition; nil;   else false; end'

  # mutation of else body
  mutation 'if condition; true;  else true;  end'
  mutation 'if condition; true;  else nil;   end'
end

Mutant::Meta::Example.add :if do
  source 'if condition; true; end'

  singleton_mutations
  mutation 'if !condition; true;  end'
  mutation 'if condition;  false; end'
  mutation 'if condition;  nil;   end'
  mutation 'if true;       true;  end'
  mutation 'if false;      true;  end'
  mutation 'if nil;        true;  end'
  mutation 'true'
end

Mutant::Meta::Example.add :if do
  source 'unless condition; true; end'

  singleton_mutations
  mutation 'unless !condition; true;  end'
  mutation 'unless nil;        true;  end'
  mutation 'unless true;       true;  end'
  mutation 'unless false;      true;  end'
  mutation 'unless condition;  false; end'
  mutation 'unless condition;  nil;   end'
  mutation 'if     condition;  true;  end'
  mutation 'true'
end

Mutant::Meta::Example.add :if do
  source 'true if /foo/'

  singleton_mutations
  mutation 'false if /foo/'
  mutation 'true if //'
  mutation 'nil if /foo/'
  mutation 'true if true'
  mutation 'true if false'
  mutation 'true if nil'
  mutation 'true if /nomatch\A/'
  mutation 'true'
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mutant-0.9.8 meta/if.rb
mutant-0.9.7 meta/if.rb
mutant-0.9.6 meta/if.rb
mutant-0.9.5 meta/if.rb
mutant-0.9.4 meta/if.rb
mutant-0.9.3 meta/if.rb
mutant-0.9.2 meta/if.rb
mutant-0.9.1 meta/if.rb
mutant-0.9.0 meta/if.rb
mutant-0.8.24 meta/if.rb
mutant-0.8.23 meta/if.rb
mutant-0.8.22 meta/if.rb
mutant-0.8.21 meta/if.rb
mutant-0.8.20 meta/if.rb
mutant-0.8.19 meta/if.rb
mutant-0.8.18 meta/if.rb
mutant-0.8.17 meta/if.rb