Sha256: 8b852f91497f97330f17c737fb94f6a92d8d64921d6fb8e29d76263ad3be31a1

Contents?: true

Size: 1.75 KB

Versions: 1

Compression:

Stored size: 1.75 KB

Contents

# encoding: utf-8

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

  # mutation of condition
  mutation 'if :condition__mutant__; true; else false; end'
  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'

  # Deleted if branch resuting 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'

  mutation 'nil'
end

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

  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 'nil'
end

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

  mutation 'unless !:condition;          true;  end'
  mutation 'unless :condition__mutant__; true;  end'
  mutation 'unless nil;                  true;  end'
  mutation 'unless :condition;           false; end'
  mutation 'unless :condition;           nil;   end'
  mutation 'unless true;                 true;  end'
  mutation 'unless false;                true;  end'
  mutation 'if     :condition;           true;  end'
  mutation 'nil'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mutant-0.5.18 meta/if.rb