mutest 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.buildkite/hooks/pre-command +3 -0
- data/.buildkite/pipeline.yml +51 -0
- data/.gitattributes +1 -0
- data/.gitignore +38 -0
- data/.rspec +5 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +216 -0
- data/Gemfile.shared +3 -0
- data/LICENSE +21 -0
- data/README.md +8 -0
- data/Rakefile +24 -0
- data/bin/mutest +39 -0
- data/build/Dockerfile +71 -0
- data/build/docker-bootstrap.sh +85 -0
- data/build/docker-exec +29 -0
- data/build/make-docker +3 -0
- data/build/ruby_matrix +1 -0
- data/build/run +5 -0
- data/build/strict-mode.sh +16 -0
- data/circle.yml +7 -0
- data/config/devtools.yml +2 -0
- data/config/flay.yml +3 -0
- data/config/flog.yml +2 -0
- data/config/reek.yml +137 -0
- data/config/rubocop.yml +395 -0
- data/config/triage.yml +2 -0
- data/config/yardstick.yml +2 -0
- data/lib/mutest.rb +243 -0
- data/lib/mutest/actor.rb +52 -0
- data/lib/mutest/actor/env.rb +28 -0
- data/lib/mutest/actor/mailbox.rb +31 -0
- data/lib/mutest/actor/receiver.rb +39 -0
- data/lib/mutest/actor/sender.rb +22 -0
- data/lib/mutest/ast.rb +44 -0
- data/lib/mutest/ast/meta.rb +7 -0
- data/lib/mutest/ast/meta/const.rb +22 -0
- data/lib/mutest/ast/meta/optarg.rb +24 -0
- data/lib/mutest/ast/meta/resbody.rb +15 -0
- data/lib/mutest/ast/meta/restarg.rb +15 -0
- data/lib/mutest/ast/meta/send.rb +89 -0
- data/lib/mutest/ast/meta/symbol.rb +15 -0
- data/lib/mutest/ast/named_children.rb +86 -0
- data/lib/mutest/ast/node_predicates.rb +17 -0
- data/lib/mutest/ast/nodes.rb +22 -0
- data/lib/mutest/ast/regexp.rb +50 -0
- data/lib/mutest/ast/regexp/transformer.rb +184 -0
- data/lib/mutest/ast/regexp/transformer/alternative.rb +39 -0
- data/lib/mutest/ast/regexp/transformer/character_set.rb +46 -0
- data/lib/mutest/ast/regexp/transformer/direct.rb +101 -0
- data/lib/mutest/ast/regexp/transformer/options_group.rb +65 -0
- data/lib/mutest/ast/regexp/transformer/quantifier.rb +112 -0
- data/lib/mutest/ast/regexp/transformer/recursive.rb +50 -0
- data/lib/mutest/ast/regexp/transformer/root.rb +28 -0
- data/lib/mutest/ast/regexp/transformer/text.rb +55 -0
- data/lib/mutest/ast/sexp.rb +26 -0
- data/lib/mutest/ast/types.rb +140 -0
- data/lib/mutest/cli.rb +196 -0
- data/lib/mutest/color.rb +39 -0
- data/lib/mutest/config.rb +28 -0
- data/lib/mutest/context.rb +98 -0
- data/lib/mutest/diff.rb +111 -0
- data/lib/mutest/env.rb +59 -0
- data/lib/mutest/env/bootstrap.rb +159 -0
- data/lib/mutest/expression.rb +55 -0
- data/lib/mutest/expression/method.rb +54 -0
- data/lib/mutest/expression/methods.rb +58 -0
- data/lib/mutest/expression/namespace.rb +75 -0
- data/lib/mutest/expression/parser.rb +64 -0
- data/lib/mutest/integration.rb +75 -0
- data/lib/mutest/isolation.rb +11 -0
- data/lib/mutest/isolation/fork.rb +72 -0
- data/lib/mutest/isolation/none.rb +23 -0
- data/lib/mutest/loader.rb +27 -0
- data/lib/mutest/matcher.rb +14 -0
- data/lib/mutest/matcher/chain.rb +19 -0
- data/lib/mutest/matcher/compiler.rb +55 -0
- data/lib/mutest/matcher/config.rb +81 -0
- data/lib/mutest/matcher/filter.rb +19 -0
- data/lib/mutest/matcher/method.rb +138 -0
- data/lib/mutest/matcher/method/instance.rb +63 -0
- data/lib/mutest/matcher/method/singleton.rb +88 -0
- data/lib/mutest/matcher/methods.rb +109 -0
- data/lib/mutest/matcher/namespace.rb +41 -0
- data/lib/mutest/matcher/null.rb +17 -0
- data/lib/mutest/matcher/scope.rb +38 -0
- data/lib/mutest/matcher/static.rb +15 -0
- data/lib/mutest/meta.rb +33 -0
- data/lib/mutest/meta/example.rb +32 -0
- data/lib/mutest/meta/example/dsl.rb +107 -0
- data/lib/mutest/meta/example/verification.rb +85 -0
- data/lib/mutest/mutation.rb +101 -0
- data/lib/mutest/mutator.rb +117 -0
- data/lib/mutest/mutator/node.rb +166 -0
- data/lib/mutest/mutator/node/and_asgn.rb +25 -0
- data/lib/mutest/mutator/node/argument.rb +68 -0
- data/lib/mutest/mutator/node/arguments.rb +90 -0
- data/lib/mutest/mutator/node/begin.rb +21 -0
- data/lib/mutest/mutator/node/binary.rb +64 -0
- data/lib/mutest/mutator/node/block.rb +51 -0
- data/lib/mutest/mutator/node/break.rb +21 -0
- data/lib/mutest/mutator/node/case.rb +47 -0
- data/lib/mutest/mutator/node/class.rb +21 -0
- data/lib/mutest/mutator/node/conditional_loop.rb +25 -0
- data/lib/mutest/mutator/node/const.rb +23 -0
- data/lib/mutest/mutator/node/define.rb +79 -0
- data/lib/mutest/mutator/node/defined.rb +24 -0
- data/lib/mutest/mutator/node/dstr.rb +20 -0
- data/lib/mutest/mutator/node/dsym.rb +20 -0
- data/lib/mutest/mutator/node/generic.rb +77 -0
- data/lib/mutest/mutator/node/if.rb +57 -0
- data/lib/mutest/mutator/node/kwbegin.rb +20 -0
- data/lib/mutest/mutator/node/literal.rb +19 -0
- data/lib/mutest/mutator/node/literal/array.rb +37 -0
- data/lib/mutest/mutator/node/literal/boolean.rb +27 -0
- data/lib/mutest/mutator/node/literal/fixnum.rb +36 -0
- data/lib/mutest/mutator/node/literal/float.rb +45 -0
- data/lib/mutest/mutator/node/literal/hash.rb +52 -0
- data/lib/mutest/mutator/node/literal/nil.rb +20 -0
- data/lib/mutest/mutator/node/literal/range.rb +38 -0
- data/lib/mutest/mutator/node/literal/regex.rb +76 -0
- data/lib/mutest/mutator/node/literal/string.rb +21 -0
- data/lib/mutest/mutator/node/literal/symbol.rb +26 -0
- data/lib/mutest/mutator/node/masgn.rb +21 -0
- data/lib/mutest/mutator/node/match_current_line.rb +22 -0
- data/lib/mutest/mutator/node/mlhs.rb +21 -0
- data/lib/mutest/mutator/node/named_value/access.rb +54 -0
- data/lib/mutest/mutator/node/named_value/constant_assignment.rb +42 -0
- data/lib/mutest/mutator/node/named_value/variable_assignment.rb +47 -0
- data/lib/mutest/mutator/node/next.rb +22 -0
- data/lib/mutest/mutator/node/noop.rb +19 -0
- data/lib/mutest/mutator/node/nthref.rb +22 -0
- data/lib/mutest/mutator/node/op_asgn.rb +50 -0
- data/lib/mutest/mutator/node/or_asgn.rb +26 -0
- data/lib/mutest/mutator/node/regexp.rb +33 -0
- data/lib/mutest/mutator/node/regexp/alternation_meta.rb +21 -0
- data/lib/mutest/mutator/node/regexp/capture_group.rb +26 -0
- data/lib/mutest/mutator/node/regexp/character_type.rb +29 -0
- data/lib/mutest/mutator/node/regexp/end_of_line_anchor.rb +21 -0
- data/lib/mutest/mutator/node/regexp/end_of_string_or_before_end_of_line_anchor.rb +21 -0
- data/lib/mutest/mutator/node/regexp/one_or_more.rb +29 -0
- data/lib/mutest/mutator/node/regexp/zero_or_more.rb +29 -0
- data/lib/mutest/mutator/node/regopt.rb +28 -0
- data/lib/mutest/mutator/node/resbody.rb +34 -0
- data/lib/mutest/mutator/node/rescue.rb +69 -0
- data/lib/mutest/mutator/node/return.rb +24 -0
- data/lib/mutest/mutator/node/send.rb +270 -0
- data/lib/mutest/mutator/node/send/attribute_assignment.rb +39 -0
- data/lib/mutest/mutator/node/send/binary.rb +45 -0
- data/lib/mutest/mutator/node/send/conditional.rb +21 -0
- data/lib/mutest/mutator/node/send/index.rb +47 -0
- data/lib/mutest/mutator/node/splat.rb +23 -0
- data/lib/mutest/mutator/node/super.rb +24 -0
- data/lib/mutest/mutator/node/when.rb +60 -0
- data/lib/mutest/mutator/node/yield.rb +21 -0
- data/lib/mutest/mutator/node/zsuper.rb +20 -0
- data/lib/mutest/mutator/util.rb +11 -0
- data/lib/mutest/mutator/util/array.rb +42 -0
- data/lib/mutest/mutator/util/symbol.rb +19 -0
- data/lib/mutest/parallel.rb +89 -0
- data/lib/mutest/parallel/master.rb +181 -0
- data/lib/mutest/parallel/source.rb +57 -0
- data/lib/mutest/parallel/worker.rb +76 -0
- data/lib/mutest/parser.rb +22 -0
- data/lib/mutest/registry.rb +43 -0
- data/lib/mutest/reporter.rb +39 -0
- data/lib/mutest/reporter/cli.rb +87 -0
- data/lib/mutest/reporter/cli/format.rb +135 -0
- data/lib/mutest/reporter/cli/printer.rb +124 -0
- data/lib/mutest/reporter/cli/printer/config.rb +24 -0
- data/lib/mutest/reporter/cli/printer/env_progress.rb +76 -0
- data/lib/mutest/reporter/cli/printer/env_result.rb +20 -0
- data/lib/mutest/reporter/cli/printer/mutation_progress_result.rb +31 -0
- data/lib/mutest/reporter/cli/printer/mutation_result.rb +127 -0
- data/lib/mutest/reporter/cli/printer/status.rb +49 -0
- data/lib/mutest/reporter/cli/printer/status_progressive.rb +46 -0
- data/lib/mutest/reporter/cli/printer/subject_progress.rb +65 -0
- data/lib/mutest/reporter/cli/printer/subject_result.rb +23 -0
- data/lib/mutest/reporter/cli/printer/test_result.rb +28 -0
- data/lib/mutest/reporter/cli/tput.rb +43 -0
- data/lib/mutest/reporter/null.rb +14 -0
- data/lib/mutest/reporter/sequence.rb +24 -0
- data/lib/mutest/repository.rb +80 -0
- data/lib/mutest/require_highjack.rb +24 -0
- data/lib/mutest/result.rb +212 -0
- data/lib/mutest/runner.rb +81 -0
- data/lib/mutest/runner/sink.rb +63 -0
- data/lib/mutest/scope.rb +6 -0
- data/lib/mutest/selector.rb +13 -0
- data/lib/mutest/selector/expression.rb +25 -0
- data/lib/mutest/source_file.rb +47 -0
- data/lib/mutest/subject.rb +94 -0
- data/lib/mutest/subject/method.rb +42 -0
- data/lib/mutest/subject/method/instance.rb +43 -0
- data/lib/mutest/subject/method/singleton.rb +19 -0
- data/lib/mutest/test.rb +14 -0
- data/lib/mutest/util.rb +18 -0
- data/lib/mutest/version.rb +4 -0
- data/lib/mutest/warning_filter.rb +58 -0
- data/lib/mutest/zombifier.rb +119 -0
- data/meta/and.rb +13 -0
- data/meta/and_asgn.rb +12 -0
- data/meta/array.rb +28 -0
- data/meta/begin.rb +19 -0
- data/meta/block.rb +104 -0
- data/meta/block_pass.rb +6 -0
- data/meta/blockarg.rb +8 -0
- data/meta/break.rb +8 -0
- data/meta/case.rb +221 -0
- data/meta/casgn.rb +26 -0
- data/meta/cbase.rb +6 -0
- data/meta/class.rb +10 -0
- data/meta/const.rb +15 -0
- data/meta/csend.rb +8 -0
- data/meta/cvar.rb +5 -0
- data/meta/cvasgn.rb +8 -0
- data/meta/date.rb +57 -0
- data/meta/def.rb +260 -0
- data/meta/defined.rb +7 -0
- data/meta/dstr.rb +11 -0
- data/meta/dsym.rb +12 -0
- data/meta/ensure.rb +7 -0
- data/meta/false.rb +6 -0
- data/meta/float.rb +35 -0
- data/meta/gvar.rb +5 -0
- data/meta/gvasgn.rb +8 -0
- data/meta/hash.rb +22 -0
- data/meta/if.rb +75 -0
- data/meta/int.rb +16 -0
- data/meta/ivar.rb +6 -0
- data/meta/ivasgn.rb +21 -0
- data/meta/kwarg.rb +8 -0
- data/meta/kwbegin.rb +7 -0
- data/meta/kwoptarg.rb +11 -0
- data/meta/kwrestarg.rb +17 -0
- data/meta/lvar.rb +14 -0
- data/meta/lvasgn.rb +8 -0
- data/meta/masgn.rb +5 -0
- data/meta/match_current_line.rb +13 -0
- data/meta/next.rb +9 -0
- data/meta/nil.rb +3 -0
- data/meta/nthref.rb +12 -0
- data/meta/op_assgn.rb +39 -0
- data/meta/or.rb +13 -0
- data/meta/or_asgn.rb +48 -0
- data/meta/range.rb +37 -0
- data/meta/redo.rb +3 -0
- data/meta/regexp.rb +84 -0
- data/meta/regexp/character_types.rb +20 -0
- data/meta/regexp/regexp_alternation_meta.rb +11 -0
- data/meta/regexp/regexp_bol_anchor.rb +8 -0
- data/meta/regexp/regexp_bos_anchor.rb +16 -0
- data/meta/regexp/regexp_capture_group.rb +17 -0
- data/meta/regexp/regexp_eol_anchor.rb +8 -0
- data/meta/regexp/regexp_eos_anchor.rb +6 -0
- data/meta/regexp/regexp_eos_ob_eol_anchor.rb +8 -0
- data/meta/regexp/regexp_one_or_more.rb +32 -0
- data/meta/regexp/regexp_root_expression.rb +8 -0
- data/meta/regexp/regexp_zero_or_more.rb +32 -0
- data/meta/regopt.rb +8 -0
- data/meta/rescue.rb +87 -0
- data/meta/restarg.rb +9 -0
- data/meta/return.rb +14 -0
- data/meta/self.rb +5 -0
- data/meta/send.rb +849 -0
- data/meta/str.rb +5 -0
- data/meta/super.rb +25 -0
- data/meta/sym.rb +6 -0
- data/meta/true.rb +6 -0
- data/meta/until.rb +15 -0
- data/meta/while.rb +24 -0
- data/meta/yield.rb +8 -0
- data/mutest-rspec.gemspec +22 -0
- data/mutest.gemspec +45 -0
- data/spec/integration/mutest/corpus_spec.rb +18 -0
- data/spec/integration/mutest/isolation/fork_spec.rb +8 -0
- data/spec/integration/mutest/null_spec.rb +13 -0
- data/spec/integration/mutest/rspec_spec.rb +11 -0
- data/spec/integration/mutest/test_mutator_handles_types_spec.rb +7 -0
- data/spec/integrations.yml +32 -0
- data/spec/rcov.opts +7 -0
- data/spec/shared/framework_integration_behavior.rb +44 -0
- data/spec/shared/method_matcher_behavior.rb +49 -0
- data/spec/spec_helper.rb +70 -0
- data/spec/support/compress_helper.rb +9 -0
- data/spec/support/corpus.rb +331 -0
- data/spec/support/fake_actor.rb +107 -0
- data/spec/support/file_system.rb +60 -0
- data/spec/support/ice_nine_config.rb +8 -0
- data/spec/support/rb_bug.rb +15 -0
- data/spec/support/ruby_vm.rb +82 -0
- data/spec/support/shared_context.rb +125 -0
- data/spec/support/test_app.rb +5 -0
- data/spec/support/warning.rb +73 -0
- data/spec/support/warnings.yml +5 -0
- data/spec/support/xspec.rb +175 -0
- data/spec/unit/mutest/actor/binding_spec.rb +32 -0
- data/spec/unit/mutest/actor/env_spec.rb +29 -0
- data/spec/unit/mutest/actor/mailbox_spec.rb +25 -0
- data/spec/unit/mutest/actor/message_spec.rb +22 -0
- data/spec/unit/mutest/actor/receiver_spec.rb +56 -0
- data/spec/unit/mutest/actor/sender_spec.rb +22 -0
- data/spec/unit/mutest/ast/meta/optarg_spec.rb +21 -0
- data/spec/unit/mutest/ast/meta/send/proc_predicate_spec.rb +28 -0
- data/spec/unit/mutest/ast/meta/send/receiver_possible_top_level_const_predicate_spec.rb +37 -0
- data/spec/unit/mutest/ast/meta/send_spec.rb +42 -0
- data/spec/unit/mutest/ast/named_children_spec.rb +87 -0
- data/spec/unit/mutest/ast/regexp/parse_spec.rb +5 -0
- data/spec/unit/mutest/ast/regexp/supported_predicate_spec.rb +14 -0
- data/spec/unit/mutest/ast/regexp/transformer/lookup_table/table_spec.rb +19 -0
- data/spec/unit/mutest/ast/regexp/transformer/lookup_table_spec.rb +33 -0
- data/spec/unit/mutest/ast/regexp/transformer_spec.rb +19 -0
- data/spec/unit/mutest/ast/regexp_spec.rb +625 -0
- data/spec/unit/mutest/ast/sexp_spec.rb +36 -0
- data/spec/unit/mutest/ast_spec.rb +55 -0
- data/spec/unit/mutest/cli_spec.rb +247 -0
- data/spec/unit/mutest/context_spec.rb +141 -0
- data/spec/unit/mutest/diff_spec.rb +185 -0
- data/spec/unit/mutest/env/bootstrap_spec.rb +188 -0
- data/spec/unit/mutest/env_spec.rb +100 -0
- data/spec/unit/mutest/expression/method_spec.rb +44 -0
- data/spec/unit/mutest/expression/methods_spec.rb +59 -0
- data/spec/unit/mutest/expression/namespace/exact_spec.rb +26 -0
- data/spec/unit/mutest/expression/namespace/recursive_spec.rb +64 -0
- data/spec/unit/mutest/expression/parser_spec.rb +67 -0
- data/spec/unit/mutest/expression_spec.rb +45 -0
- data/spec/unit/mutest/integration/null_spec.rb +28 -0
- data/spec/unit/mutest/integration/rspec_spec.rb +197 -0
- data/spec/unit/mutest/integration_spec.rb +26 -0
- data/spec/unit/mutest/isolation/fork_spec.rb +155 -0
- data/spec/unit/mutest/isolation/none_spec.rb +16 -0
- data/spec/unit/mutest/loader_spec.rb +42 -0
- data/spec/unit/mutest/matcher/chain_spec.rb +24 -0
- data/spec/unit/mutest/matcher/compiler/subject_prefix_spec.rb +24 -0
- data/spec/unit/mutest/matcher/compiler_spec.rb +76 -0
- data/spec/unit/mutest/matcher/config_spec.rb +45 -0
- data/spec/unit/mutest/matcher/filter_spec.rb +20 -0
- data/spec/unit/mutest/matcher/method/instance_spec.rb +125 -0
- data/spec/unit/mutest/matcher/method/singleton_spec.rb +85 -0
- data/spec/unit/mutest/matcher/methods/instance_spec.rb +58 -0
- data/spec/unit/mutest/matcher/methods/singleton_spec.rb +54 -0
- data/spec/unit/mutest/matcher/namespace_spec.rb +35 -0
- data/spec/unit/mutest/matcher/null_spec.rb +10 -0
- data/spec/unit/mutest/matcher/scope_spec.rb +33 -0
- data/spec/unit/mutest/matcher/static_spec.rb +11 -0
- data/spec/unit/mutest/meta/example/dsl_spec.rb +123 -0
- data/spec/unit/mutest/meta/example/verification_spec.rb +120 -0
- data/spec/unit/mutest/meta/example_spec.rb +32 -0
- data/spec/unit/mutest/mutation_spec.rb +129 -0
- data/spec/unit/mutest/mutator/node_spec.rb +43 -0
- data/spec/unit/mutest/mutator_spec.rb +30 -0
- data/spec/unit/mutest/parallel/driver_spec.rb +26 -0
- data/spec/unit/mutest/parallel/master_spec.rb +335 -0
- data/spec/unit/mutest/parallel/source/array_spec.rb +47 -0
- data/spec/unit/mutest/parallel/worker_spec.rb +65 -0
- data/spec/unit/mutest/parallel_spec.rb +16 -0
- data/spec/unit/mutest/parser_spec.rb +24 -0
- data/spec/unit/mutest/registry_spec.rb +45 -0
- data/spec/unit/mutest/reporter/cli/printer/config_spec.rb +29 -0
- data/spec/unit/mutest/reporter/cli/printer/env_progress_spec.rb +74 -0
- data/spec/unit/mutest/reporter/cli/printer/env_result_spec.rb +35 -0
- data/spec/unit/mutest/reporter/cli/printer/mutation_progress_result_spec.rb +23 -0
- data/spec/unit/mutest/reporter/cli/printer/mutation_result_spec.rb +110 -0
- data/spec/unit/mutest/reporter/cli/printer/status_progressive_spec.rb +43 -0
- data/spec/unit/mutest/reporter/cli/printer/status_spec.rb +119 -0
- data/spec/unit/mutest/reporter/cli/printer/subject_progress_spec.rb +34 -0
- data/spec/unit/mutest/reporter/cli/printer/subject_result_spec.rb +37 -0
- data/spec/unit/mutest/reporter/cli/printer/test_result_spec.rb +14 -0
- data/spec/unit/mutest/reporter/cli/printer_spec.rb +161 -0
- data/spec/unit/mutest/reporter/cli/tput_spec.rb +48 -0
- data/spec/unit/mutest/reporter/cli_spec.rb +212 -0
- data/spec/unit/mutest/reporter/null_spec.rb +12 -0
- data/spec/unit/mutest/reporter/sequence_spec.rb +29 -0
- data/spec/unit/mutest/repository/diff_spec.rb +106 -0
- data/spec/unit/mutest/repository/subject_filter_spec.rb +28 -0
- data/spec/unit/mutest/require_highjack_spec.rb +71 -0
- data/spec/unit/mutest/result/class_methods_spec.rb +49 -0
- data/spec/unit/mutest/result/env_spec.rb +82 -0
- data/spec/unit/mutest/result/mutation_spec.rb +37 -0
- data/spec/unit/mutest/result/subject_spec.rb +109 -0
- data/spec/unit/mutest/result_spec.rb +31 -0
- data/spec/unit/mutest/runner/sink_spec.rb +172 -0
- data/spec/unit/mutest/runner_spec.rb +69 -0
- data/spec/unit/mutest/selector/expression_spec.rb +59 -0
- data/spec/unit/mutest/source_file_spec.rb +42 -0
- data/spec/unit/mutest/subject/method/instance/memoized_spec.rb +78 -0
- data/spec/unit/mutest/subject/method/instance_spec.rb +64 -0
- data/spec/unit/mutest/subject/method/singleton_spec.rb +51 -0
- data/spec/unit/mutest/subject_spec.rb +87 -0
- data/spec/unit/mutest/util/one_spec.rb +20 -0
- data/spec/unit/mutest/warning_filter_spec.rb +99 -0
- data/spec/unit/mutest/zombifier_spec.rb +120 -0
- data/spec/unit/mutest_spec.rb +15 -0
- data/test_app/.rspec +1 -0
- data/test_app/Gemfile.rspec3.4 +7 -0
- data/test_app/Gemfile.rspec3.5 +7 -0
- data/test_app/lib/test_app.rb +109 -0
- data/test_app/lib/test_app/literal.rb +40 -0
- data/test_app/spec/spec_helper.rb +9 -0
- data/test_app/spec/unit/test_app/literal_spec.rb +20 -0
- metadata +784 -9
data/meta/send.rb
ADDED
@@ -0,0 +1,849 @@
|
|
1
|
+
Mutest::Meta::Example.add :send do
|
2
|
+
source 'a > b'
|
3
|
+
|
4
|
+
singleton_mutations
|
5
|
+
mutation 'a == b'
|
6
|
+
mutation 'a >= b'
|
7
|
+
mutation 'a.eql?(b)'
|
8
|
+
mutation 'a.equal?(b)'
|
9
|
+
mutation 'nil > b'
|
10
|
+
mutation 'self > b'
|
11
|
+
mutation 'a > nil'
|
12
|
+
mutation 'a > self'
|
13
|
+
mutation 'a'
|
14
|
+
mutation 'b'
|
15
|
+
end
|
16
|
+
|
17
|
+
Mutest::Meta::Example.add :send do
|
18
|
+
source 'A.const_get(:B)'
|
19
|
+
|
20
|
+
singleton_mutations
|
21
|
+
mutation 'A::B'
|
22
|
+
mutation 'A.const_get'
|
23
|
+
mutation 'A'
|
24
|
+
mutation ':B'
|
25
|
+
mutation 'A.const_get(nil)'
|
26
|
+
mutation 'A.const_get(self)'
|
27
|
+
mutation 'A.const_get(:B__mutest__)'
|
28
|
+
mutation 'self.const_get(:B)'
|
29
|
+
end
|
30
|
+
|
31
|
+
Mutest::Meta::Example.add :send do
|
32
|
+
source 'A.const_get(bar)'
|
33
|
+
|
34
|
+
singleton_mutations
|
35
|
+
mutation 'A.const_get'
|
36
|
+
mutation 'A'
|
37
|
+
mutation 'bar'
|
38
|
+
mutation 'A.const_get(nil)'
|
39
|
+
mutation 'A.const_get(self)'
|
40
|
+
mutation 'self.const_get(bar)'
|
41
|
+
end
|
42
|
+
|
43
|
+
Mutest::Meta::Example.add :send do
|
44
|
+
source 'method(bar)'
|
45
|
+
|
46
|
+
singleton_mutations
|
47
|
+
mutation 'public_method(bar)'
|
48
|
+
mutation 'method'
|
49
|
+
mutation 'bar'
|
50
|
+
mutation 'method(nil)'
|
51
|
+
mutation 'method(self)'
|
52
|
+
end
|
53
|
+
|
54
|
+
Mutest::Meta::Example.add :send do
|
55
|
+
source 'a >= b'
|
56
|
+
|
57
|
+
singleton_mutations
|
58
|
+
mutation 'a > b'
|
59
|
+
mutation 'a == b'
|
60
|
+
mutation 'a.eql?(b)'
|
61
|
+
mutation 'a.equal?(b)'
|
62
|
+
mutation 'nil >= b'
|
63
|
+
mutation 'self >= b'
|
64
|
+
mutation 'a >= nil'
|
65
|
+
mutation 'a >= self'
|
66
|
+
mutation 'a'
|
67
|
+
mutation 'b'
|
68
|
+
end
|
69
|
+
|
70
|
+
Mutest::Meta::Example.add :send do
|
71
|
+
source 'a <= b'
|
72
|
+
|
73
|
+
singleton_mutations
|
74
|
+
mutation 'a < b'
|
75
|
+
mutation 'a == b'
|
76
|
+
mutation 'a.eql?(b)'
|
77
|
+
mutation 'a.equal?(b)'
|
78
|
+
mutation 'nil <= b'
|
79
|
+
mutation 'self <= b'
|
80
|
+
mutation 'a <= nil'
|
81
|
+
mutation 'a <= self'
|
82
|
+
mutation 'a'
|
83
|
+
mutation 'b'
|
84
|
+
end
|
85
|
+
|
86
|
+
Mutest::Meta::Example.add :send do
|
87
|
+
source 'a < b'
|
88
|
+
|
89
|
+
singleton_mutations
|
90
|
+
mutation 'a == b'
|
91
|
+
mutation 'a <= b'
|
92
|
+
mutation 'a.eql?(b)'
|
93
|
+
mutation 'a.equal?(b)'
|
94
|
+
mutation 'nil < b'
|
95
|
+
mutation 'self < b'
|
96
|
+
mutation 'a < nil'
|
97
|
+
mutation 'a < self'
|
98
|
+
mutation 'a'
|
99
|
+
mutation 'b'
|
100
|
+
end
|
101
|
+
|
102
|
+
Mutest::Meta::Example.add :send do
|
103
|
+
source 'reverse_each'
|
104
|
+
|
105
|
+
singleton_mutations
|
106
|
+
mutation 'each'
|
107
|
+
end
|
108
|
+
|
109
|
+
Mutest::Meta::Example.add :send do
|
110
|
+
source 'reverse_merge'
|
111
|
+
|
112
|
+
singleton_mutations
|
113
|
+
mutation 'merge'
|
114
|
+
end
|
115
|
+
|
116
|
+
Mutest::Meta::Example.add :send do
|
117
|
+
source 'reverse_map'
|
118
|
+
|
119
|
+
singleton_mutations
|
120
|
+
mutation 'map'
|
121
|
+
mutation 'each'
|
122
|
+
end
|
123
|
+
|
124
|
+
Mutest::Meta::Example.add :send do
|
125
|
+
source 'map'
|
126
|
+
|
127
|
+
singleton_mutations
|
128
|
+
mutation 'each'
|
129
|
+
end
|
130
|
+
|
131
|
+
Mutest::Meta::Example.add :send do
|
132
|
+
source 'flat_map'
|
133
|
+
|
134
|
+
singleton_mutations
|
135
|
+
mutation 'map'
|
136
|
+
end
|
137
|
+
|
138
|
+
Mutest::Meta::Example.add :send do
|
139
|
+
source 'foo.to_s'
|
140
|
+
|
141
|
+
singleton_mutations
|
142
|
+
mutation 'foo'
|
143
|
+
mutation 'self.to_s'
|
144
|
+
mutation 'foo.to_str'
|
145
|
+
end
|
146
|
+
|
147
|
+
Mutest::Meta::Example.add :send do
|
148
|
+
source 'foo.to_a'
|
149
|
+
|
150
|
+
singleton_mutations
|
151
|
+
mutation 'foo'
|
152
|
+
mutation 'self.to_a'
|
153
|
+
mutation 'foo.to_ary'
|
154
|
+
mutation 'foo.to_set'
|
155
|
+
end
|
156
|
+
|
157
|
+
Mutest::Meta::Example.add :send do
|
158
|
+
source 'foo.to_i'
|
159
|
+
|
160
|
+
singleton_mutations
|
161
|
+
mutation 'foo'
|
162
|
+
mutation 'self.to_i'
|
163
|
+
mutation 'foo.to_int'
|
164
|
+
mutation 'Integer(foo)'
|
165
|
+
end
|
166
|
+
|
167
|
+
Mutest::Meta::Example.add :send do
|
168
|
+
source 'foo.to_h'
|
169
|
+
|
170
|
+
singleton_mutations
|
171
|
+
mutation 'foo'
|
172
|
+
mutation 'self.to_h'
|
173
|
+
mutation 'foo.to_hash'
|
174
|
+
end
|
175
|
+
|
176
|
+
Mutest::Meta::Example.add :send do
|
177
|
+
source 'foo == bar'
|
178
|
+
|
179
|
+
singleton_mutations
|
180
|
+
mutation 'foo'
|
181
|
+
mutation 'bar'
|
182
|
+
mutation 'nil == bar'
|
183
|
+
mutation 'self == bar'
|
184
|
+
mutation 'foo == nil'
|
185
|
+
mutation 'foo == self'
|
186
|
+
mutation 'foo.eql?(bar)'
|
187
|
+
mutation 'foo.equal?(bar)'
|
188
|
+
end
|
189
|
+
|
190
|
+
Mutest::Meta::Example.add :send do
|
191
|
+
source 'foo.is_a?(bar)'
|
192
|
+
|
193
|
+
singleton_mutations
|
194
|
+
mutation 'foo'
|
195
|
+
mutation 'bar'
|
196
|
+
mutation 'foo.is_a?'
|
197
|
+
mutation 'foo.is_a?(nil)'
|
198
|
+
mutation 'foo.is_a?(self)'
|
199
|
+
mutation 'self.is_a?(bar)'
|
200
|
+
mutation 'foo.instance_of?(bar)'
|
201
|
+
end
|
202
|
+
|
203
|
+
Mutest::Meta::Example.add :send do
|
204
|
+
source 'foo.is_a?(bar)'
|
205
|
+
|
206
|
+
singleton_mutations
|
207
|
+
mutation 'foo'
|
208
|
+
mutation 'bar'
|
209
|
+
mutation 'foo.is_a?'
|
210
|
+
mutation 'foo.is_a?(nil)'
|
211
|
+
mutation 'foo.is_a?(self)'
|
212
|
+
mutation 'self.is_a?(bar)'
|
213
|
+
mutation 'foo.instance_of?(bar)'
|
214
|
+
end
|
215
|
+
|
216
|
+
Mutest::Meta::Example.add :send do
|
217
|
+
source 'foo.kind_of?(bar)'
|
218
|
+
|
219
|
+
singleton_mutations
|
220
|
+
mutation 'foo'
|
221
|
+
mutation 'bar'
|
222
|
+
mutation 'foo.kind_of?'
|
223
|
+
mutation 'foo.kind_of?(nil)'
|
224
|
+
mutation 'foo.kind_of?(self)'
|
225
|
+
mutation 'self.kind_of?(bar)'
|
226
|
+
mutation 'foo.instance_of?(bar)'
|
227
|
+
end
|
228
|
+
|
229
|
+
Mutest::Meta::Example.add :send do
|
230
|
+
source 'foo.gsub(a, b)'
|
231
|
+
|
232
|
+
singleton_mutations
|
233
|
+
mutation 'foo'
|
234
|
+
mutation 'foo.gsub(a)'
|
235
|
+
mutation 'foo.gsub(b)'
|
236
|
+
mutation 'foo.gsub'
|
237
|
+
mutation 'foo.sub(a, b)'
|
238
|
+
mutation 'foo.gsub(a, nil)'
|
239
|
+
mutation 'foo.gsub(a, self)'
|
240
|
+
mutation 'foo.gsub(nil, b)'
|
241
|
+
mutation 'foo.gsub(self, b)'
|
242
|
+
mutation 'self.gsub(a, b)'
|
243
|
+
end
|
244
|
+
|
245
|
+
Mutest::Meta::Example.add :send do
|
246
|
+
source 'foo.values_at(a, b)'
|
247
|
+
|
248
|
+
singleton_mutations
|
249
|
+
mutation 'foo.fetch_values(a, b)'
|
250
|
+
mutation 'foo'
|
251
|
+
mutation 'self.values_at(a, b)'
|
252
|
+
mutation 'foo.values_at(a)'
|
253
|
+
mutation 'foo.values_at(b)'
|
254
|
+
mutation 'foo.values_at(nil, b)'
|
255
|
+
mutation 'foo.values_at(self, b)'
|
256
|
+
mutation 'foo.values_at(a, nil)'
|
257
|
+
mutation 'foo.values_at(a, self)'
|
258
|
+
mutation 'foo.values_at'
|
259
|
+
end
|
260
|
+
|
261
|
+
Mutest::Meta::Example.add :send do
|
262
|
+
source 'foo.dig(a, b)'
|
263
|
+
|
264
|
+
singleton_mutations
|
265
|
+
mutation 'foo.fetch(a).dig(b)'
|
266
|
+
mutation 'foo'
|
267
|
+
mutation 'self.dig(a, b)'
|
268
|
+
mutation 'foo.dig(a)'
|
269
|
+
mutation 'foo.dig(b)'
|
270
|
+
mutation 'foo.dig(nil, b)'
|
271
|
+
mutation 'foo.dig(self, b)'
|
272
|
+
mutation 'foo.dig(a, nil)'
|
273
|
+
mutation 'foo.dig(a, self)'
|
274
|
+
mutation 'foo.dig'
|
275
|
+
end
|
276
|
+
|
277
|
+
Mutest::Meta::Example.add :send do
|
278
|
+
source 'foo.dig(a)'
|
279
|
+
|
280
|
+
singleton_mutations
|
281
|
+
mutation 'foo.fetch(a)'
|
282
|
+
mutation 'foo'
|
283
|
+
mutation 'self.dig(a)'
|
284
|
+
mutation 'foo.dig(nil)'
|
285
|
+
mutation 'foo.dig(self)'
|
286
|
+
mutation 'foo.dig'
|
287
|
+
mutation 'a'
|
288
|
+
end
|
289
|
+
|
290
|
+
Mutest::Meta::Example.add :send do
|
291
|
+
source 'foo.dig'
|
292
|
+
|
293
|
+
singleton_mutations
|
294
|
+
mutation 'foo'
|
295
|
+
mutation 'self.dig'
|
296
|
+
end
|
297
|
+
|
298
|
+
Mutest::Meta::Example.add :send do
|
299
|
+
source 'foo.__send__(bar)'
|
300
|
+
|
301
|
+
singleton_mutations
|
302
|
+
mutation 'foo.__send__'
|
303
|
+
mutation 'foo.public_send(bar)'
|
304
|
+
mutation 'bar'
|
305
|
+
mutation 'foo'
|
306
|
+
mutation 'self.__send__(bar)'
|
307
|
+
mutation 'foo.__send__(nil)'
|
308
|
+
mutation 'foo.__send__(self)'
|
309
|
+
end
|
310
|
+
|
311
|
+
Mutest::Meta::Example.add :send do
|
312
|
+
source 'foo.send(bar)'
|
313
|
+
|
314
|
+
singleton_mutations
|
315
|
+
mutation 'foo.send'
|
316
|
+
mutation 'foo.public_send(bar)'
|
317
|
+
mutation 'foo.__send__(bar)'
|
318
|
+
mutation 'bar'
|
319
|
+
mutation 'foo'
|
320
|
+
mutation 'self.send(bar)'
|
321
|
+
mutation 'foo.send(nil)'
|
322
|
+
mutation 'foo.send(self)'
|
323
|
+
end
|
324
|
+
|
325
|
+
Mutest::Meta::Example.add :send do
|
326
|
+
source 'self.booz = baz'
|
327
|
+
|
328
|
+
singleton_mutations
|
329
|
+
mutation 'self.booz = nil'
|
330
|
+
mutation 'self.booz = self'
|
331
|
+
mutation 'self.booz'
|
332
|
+
mutation 'baz'
|
333
|
+
end
|
334
|
+
|
335
|
+
Mutest::Meta::Example.add :send do
|
336
|
+
source 'foo.booz = baz'
|
337
|
+
|
338
|
+
singleton_mutations
|
339
|
+
mutation 'foo'
|
340
|
+
mutation 'foo.booz = nil'
|
341
|
+
mutation 'foo.booz = self'
|
342
|
+
mutation 'self.booz = baz'
|
343
|
+
mutation 'foo.booz'
|
344
|
+
mutation 'baz'
|
345
|
+
end
|
346
|
+
|
347
|
+
Mutest::Meta::Example.add :send do
|
348
|
+
source 'foo[bar] = baz'
|
349
|
+
|
350
|
+
singleton_mutations
|
351
|
+
mutation 'foo'
|
352
|
+
mutation 'foo[bar]'
|
353
|
+
mutation 'foo[bar] = self'
|
354
|
+
mutation 'foo[bar] = nil'
|
355
|
+
mutation 'foo[nil] = baz'
|
356
|
+
mutation 'foo[self] = baz'
|
357
|
+
mutation 'foo[] = baz'
|
358
|
+
mutation 'baz'
|
359
|
+
end
|
360
|
+
|
361
|
+
Mutest::Meta::Example.add :send do
|
362
|
+
source 'foo(*bar)'
|
363
|
+
|
364
|
+
singleton_mutations
|
365
|
+
mutation 'foo'
|
366
|
+
mutation 'foo(nil)'
|
367
|
+
mutation 'foo(bar)'
|
368
|
+
mutation 'foo(self)'
|
369
|
+
mutation 'foo(*nil)'
|
370
|
+
mutation 'foo(*self)'
|
371
|
+
end
|
372
|
+
|
373
|
+
Mutest::Meta::Example.add :send do
|
374
|
+
source 'foo(&bar)'
|
375
|
+
|
376
|
+
singleton_mutations
|
377
|
+
mutation 'foo'
|
378
|
+
end
|
379
|
+
|
380
|
+
Mutest::Meta::Example.add :send do
|
381
|
+
source 'foo'
|
382
|
+
|
383
|
+
singleton_mutations
|
384
|
+
end
|
385
|
+
|
386
|
+
Mutest::Meta::Example.add :send do
|
387
|
+
source 'self.foo'
|
388
|
+
|
389
|
+
singleton_mutations
|
390
|
+
mutation 'foo'
|
391
|
+
end
|
392
|
+
|
393
|
+
Unparser::Constants::KEYWORDS.each do |keyword|
|
394
|
+
Mutest::Meta::Example.add :send do
|
395
|
+
source "self.#{keyword}"
|
396
|
+
|
397
|
+
singleton_mutations
|
398
|
+
end
|
399
|
+
end
|
400
|
+
|
401
|
+
Mutest::Meta::Example.add :send do
|
402
|
+
source 'foo.bar'
|
403
|
+
|
404
|
+
singleton_mutations
|
405
|
+
mutation 'foo'
|
406
|
+
mutation 'self.bar'
|
407
|
+
end
|
408
|
+
|
409
|
+
Mutest::Meta::Example.add :send do
|
410
|
+
source 'self.class.foo'
|
411
|
+
|
412
|
+
singleton_mutations
|
413
|
+
mutation 'self.class'
|
414
|
+
mutation 'self.foo'
|
415
|
+
end
|
416
|
+
|
417
|
+
Mutest::Meta::Example.add :send do
|
418
|
+
source 'foo(nil)'
|
419
|
+
|
420
|
+
singleton_mutations
|
421
|
+
mutation 'foo'
|
422
|
+
end
|
423
|
+
|
424
|
+
Mutest::Meta::Example.add :send do
|
425
|
+
source 'self.foo(nil)'
|
426
|
+
|
427
|
+
singleton_mutations
|
428
|
+
mutation 'self.foo'
|
429
|
+
mutation 'foo(nil)'
|
430
|
+
end
|
431
|
+
|
432
|
+
Mutest::Meta::Example.add :send do
|
433
|
+
source 'self.fetch(nil)'
|
434
|
+
|
435
|
+
singleton_mutations
|
436
|
+
mutation 'self.fetch'
|
437
|
+
mutation 'fetch(nil)'
|
438
|
+
mutation 'self.key?(nil)'
|
439
|
+
end
|
440
|
+
|
441
|
+
Unparser::Constants::KEYWORDS.each do |keyword|
|
442
|
+
Mutest::Meta::Example.add :send do
|
443
|
+
source "foo.#{keyword}(nil)"
|
444
|
+
|
445
|
+
singleton_mutations
|
446
|
+
mutation "self.#{keyword}(nil)"
|
447
|
+
mutation "foo.#{keyword}"
|
448
|
+
mutation 'foo'
|
449
|
+
end
|
450
|
+
end
|
451
|
+
|
452
|
+
Mutest::Meta::Example.add :send do
|
453
|
+
source 'foo(nil, nil)'
|
454
|
+
|
455
|
+
singleton_mutations
|
456
|
+
mutation 'foo()'
|
457
|
+
mutation 'foo(nil)'
|
458
|
+
end
|
459
|
+
|
460
|
+
Mutest::Meta::Example.add :send do
|
461
|
+
source '(left - right) / foo'
|
462
|
+
|
463
|
+
singleton_mutations
|
464
|
+
mutation 'foo'
|
465
|
+
mutation '(left - right)'
|
466
|
+
mutation 'left / foo'
|
467
|
+
mutation 'right / foo'
|
468
|
+
mutation '(left - right) / nil'
|
469
|
+
mutation '(left - right) / self'
|
470
|
+
mutation '(left - nil) / foo'
|
471
|
+
mutation '(left - self) / foo'
|
472
|
+
mutation '(nil - right) / foo'
|
473
|
+
mutation '(self - right) / foo'
|
474
|
+
mutation 'nil / foo'
|
475
|
+
mutation 'self / foo'
|
476
|
+
end
|
477
|
+
|
478
|
+
Mutest::Meta::Example.add :send do
|
479
|
+
source 'foo[1]'
|
480
|
+
|
481
|
+
singleton_mutations
|
482
|
+
mutation '1'
|
483
|
+
mutation 'foo'
|
484
|
+
mutation 'foo[]'
|
485
|
+
mutation 'foo.at(1)'
|
486
|
+
mutation 'foo.fetch(1)'
|
487
|
+
mutation 'foo.key?(1)'
|
488
|
+
mutation 'self[1]'
|
489
|
+
mutation 'foo[0]'
|
490
|
+
mutation 'foo[2]'
|
491
|
+
mutation 'foo[-1]'
|
492
|
+
mutation 'foo[nil]'
|
493
|
+
mutation 'foo[self]'
|
494
|
+
end
|
495
|
+
|
496
|
+
Mutest::Meta::Example.add :send do
|
497
|
+
source 'self.foo[]'
|
498
|
+
|
499
|
+
singleton_mutations
|
500
|
+
mutation 'self.foo'
|
501
|
+
mutation 'self.foo.at()'
|
502
|
+
mutation 'self.foo.fetch()'
|
503
|
+
mutation 'self.foo.key?()'
|
504
|
+
mutation 'self[]'
|
505
|
+
mutation 'foo[]'
|
506
|
+
end
|
507
|
+
|
508
|
+
Mutest::Meta::Example.add :send do
|
509
|
+
source 'foo(n..-1)'
|
510
|
+
|
511
|
+
singleton_mutations
|
512
|
+
mutation 'foo'
|
513
|
+
mutation 'n..-1'
|
514
|
+
mutation 'foo(nil)'
|
515
|
+
mutation 'foo(self)'
|
516
|
+
mutation 'foo(n...-1)'
|
517
|
+
mutation 'foo(nil..-1)'
|
518
|
+
mutation 'foo(self..-1)'
|
519
|
+
mutation 'foo(n..nil)'
|
520
|
+
mutation 'foo(n..self)'
|
521
|
+
mutation 'foo(n..0)'
|
522
|
+
mutation 'foo(n..1)'
|
523
|
+
mutation 'foo(n..-2)'
|
524
|
+
end
|
525
|
+
|
526
|
+
Mutest::Meta::Example.add :send do
|
527
|
+
source 'foo[n..-2]'
|
528
|
+
|
529
|
+
singleton_mutations
|
530
|
+
mutation 'n..-2'
|
531
|
+
mutation 'foo'
|
532
|
+
mutation 'foo[]'
|
533
|
+
mutation 'foo.at(n..-2)'
|
534
|
+
mutation 'foo.fetch(n..-2)'
|
535
|
+
mutation 'foo.key?(n..-2)'
|
536
|
+
mutation 'self[n..-2]'
|
537
|
+
mutation 'foo[nil]'
|
538
|
+
mutation 'foo[self]'
|
539
|
+
mutation 'foo[n..nil]'
|
540
|
+
mutation 'foo[n..self]'
|
541
|
+
mutation 'foo[n..-1]'
|
542
|
+
mutation 'foo[n..2]'
|
543
|
+
mutation 'foo[n..0]'
|
544
|
+
mutation 'foo[n..1]'
|
545
|
+
mutation 'foo[n..-3]'
|
546
|
+
mutation 'foo[n...-2]'
|
547
|
+
mutation 'foo[nil..-2]'
|
548
|
+
mutation 'foo[self..-2]'
|
549
|
+
end
|
550
|
+
|
551
|
+
Mutest::Meta::Example.add :send do
|
552
|
+
source 'foo[n...-1]'
|
553
|
+
|
554
|
+
singleton_mutations
|
555
|
+
mutation 'n...-1'
|
556
|
+
mutation 'foo'
|
557
|
+
mutation 'foo[]'
|
558
|
+
mutation 'foo.at(n...-1)'
|
559
|
+
mutation 'foo.fetch(n...-1)'
|
560
|
+
mutation 'foo.key?(n...-1)'
|
561
|
+
mutation 'self[n...-1]'
|
562
|
+
mutation 'foo[nil]'
|
563
|
+
mutation 'foo[self]'
|
564
|
+
mutation 'foo[n...nil]'
|
565
|
+
mutation 'foo[n...self]'
|
566
|
+
mutation 'foo[n..-1]'
|
567
|
+
mutation 'foo[n...0]'
|
568
|
+
mutation 'foo[n...1]'
|
569
|
+
mutation 'foo[n...-2]'
|
570
|
+
mutation 'foo[nil...-1]'
|
571
|
+
mutation 'foo[self...-1]'
|
572
|
+
end
|
573
|
+
|
574
|
+
Mutest::Meta::Example.add :send do
|
575
|
+
source 'foo[n..-1]'
|
576
|
+
|
577
|
+
singleton_mutations
|
578
|
+
mutation 'n..-1'
|
579
|
+
mutation 'foo'
|
580
|
+
mutation 'foo[]'
|
581
|
+
mutation 'foo.at(n..-1)'
|
582
|
+
mutation 'foo.fetch(n..-1)'
|
583
|
+
mutation 'foo.key?(n..-1)'
|
584
|
+
mutation 'self[n..-1]'
|
585
|
+
mutation 'foo[nil]'
|
586
|
+
mutation 'foo[self]'
|
587
|
+
mutation 'foo[n..nil]'
|
588
|
+
mutation 'foo[n..self]'
|
589
|
+
mutation 'foo[n..0]'
|
590
|
+
mutation 'foo[n..1]'
|
591
|
+
mutation 'foo[n..-2]'
|
592
|
+
mutation 'foo[n...-1]'
|
593
|
+
mutation 'foo[nil..-1]'
|
594
|
+
mutation 'foo[self..-1]'
|
595
|
+
mutation 'foo.drop(n)'
|
596
|
+
end
|
597
|
+
|
598
|
+
Mutest::Meta::Example.add :send do
|
599
|
+
source 'self[foo]'
|
600
|
+
|
601
|
+
singleton_mutations
|
602
|
+
mutation 'self[self]'
|
603
|
+
mutation 'self[nil]'
|
604
|
+
mutation 'self[]'
|
605
|
+
mutation 'self.at(foo)'
|
606
|
+
mutation 'self.fetch(foo)'
|
607
|
+
mutation 'self.key?(foo)'
|
608
|
+
mutation 'foo'
|
609
|
+
end
|
610
|
+
|
611
|
+
Mutest::Meta::Example.add :send do
|
612
|
+
source 'foo[*bar]'
|
613
|
+
|
614
|
+
singleton_mutations
|
615
|
+
mutation 'foo'
|
616
|
+
mutation 'foo[]'
|
617
|
+
mutation 'foo.at(*bar)'
|
618
|
+
mutation 'foo.fetch(*bar)'
|
619
|
+
mutation 'foo.key?(*bar)'
|
620
|
+
mutation 'foo[nil]'
|
621
|
+
mutation 'foo[self]'
|
622
|
+
mutation 'foo[bar]'
|
623
|
+
mutation 'foo[*self]'
|
624
|
+
mutation 'foo[*nil]'
|
625
|
+
mutation 'self[*bar]'
|
626
|
+
end
|
627
|
+
|
628
|
+
(Mutest::AST::Types::BINARY_METHOD_OPERATORS - %i[=~ <= >= < > == != eql? ===]).each do |operator|
|
629
|
+
Mutest::Meta::Example.add :send do
|
630
|
+
source "true #{operator} false"
|
631
|
+
|
632
|
+
singleton_mutations
|
633
|
+
mutation 'true'
|
634
|
+
mutation 'false'
|
635
|
+
mutation "false #{operator} false"
|
636
|
+
mutation "nil #{operator} false"
|
637
|
+
mutation "true #{operator} true"
|
638
|
+
mutation "true #{operator} nil"
|
639
|
+
end
|
640
|
+
end
|
641
|
+
|
642
|
+
Mutest::Meta::Example.add :send do
|
643
|
+
source 'a != b'
|
644
|
+
|
645
|
+
singleton_mutations
|
646
|
+
mutation 'nil != b'
|
647
|
+
mutation 'self != b'
|
648
|
+
mutation 'a'
|
649
|
+
mutation 'b'
|
650
|
+
mutation 'a != nil'
|
651
|
+
mutation 'a != self'
|
652
|
+
mutation '!a.eql?(b)'
|
653
|
+
mutation '!a.equal?(b)'
|
654
|
+
end
|
655
|
+
|
656
|
+
Mutest::Meta::Example.add :send do
|
657
|
+
source 'sample'
|
658
|
+
|
659
|
+
singleton_mutations
|
660
|
+
mutation 'first'
|
661
|
+
mutation 'last'
|
662
|
+
end
|
663
|
+
|
664
|
+
Mutest::Meta::Example.add :send do
|
665
|
+
source 'pop'
|
666
|
+
|
667
|
+
singleton_mutations
|
668
|
+
mutation 'last'
|
669
|
+
end
|
670
|
+
|
671
|
+
Mutest::Meta::Example.add :send do
|
672
|
+
source 'shift'
|
673
|
+
|
674
|
+
singleton_mutations
|
675
|
+
mutation 'first'
|
676
|
+
end
|
677
|
+
|
678
|
+
Mutest::Meta::Example.add :send do
|
679
|
+
source 'first'
|
680
|
+
|
681
|
+
singleton_mutations
|
682
|
+
mutation 'last'
|
683
|
+
end
|
684
|
+
|
685
|
+
Mutest::Meta::Example.add :send do
|
686
|
+
source 'last'
|
687
|
+
|
688
|
+
singleton_mutations
|
689
|
+
mutation 'first'
|
690
|
+
end
|
691
|
+
|
692
|
+
Mutest::Meta::Example.add :send do
|
693
|
+
source '!!foo'
|
694
|
+
|
695
|
+
singleton_mutations
|
696
|
+
mutation '!foo'
|
697
|
+
mutation '!self'
|
698
|
+
mutation '!!self'
|
699
|
+
mutation 'foo'
|
700
|
+
end
|
701
|
+
|
702
|
+
Mutest::Meta::Example.add :send do
|
703
|
+
source '!foo'
|
704
|
+
|
705
|
+
singleton_mutations
|
706
|
+
mutation 'foo'
|
707
|
+
mutation '!self'
|
708
|
+
end
|
709
|
+
|
710
|
+
Mutest::Meta::Example.add :send do
|
711
|
+
source '!foo&.!'
|
712
|
+
|
713
|
+
singleton_mutations
|
714
|
+
mutation 'foo&.!'
|
715
|
+
mutation '!self'
|
716
|
+
mutation '!foo'
|
717
|
+
mutation '!self&.!'
|
718
|
+
mutation '!(!foo)'
|
719
|
+
end
|
720
|
+
|
721
|
+
Mutest::Meta::Example.add :send do
|
722
|
+
source 'custom.proc { }'
|
723
|
+
|
724
|
+
singleton_mutations
|
725
|
+
mutation 'custom.proc'
|
726
|
+
mutation 'custom { }'
|
727
|
+
mutation 'self.proc { }'
|
728
|
+
mutation 'custom.proc { raise }'
|
729
|
+
end
|
730
|
+
|
731
|
+
Mutest::Meta::Example.add :send do
|
732
|
+
source 'proc { }'
|
733
|
+
|
734
|
+
singleton_mutations
|
735
|
+
mutation 'proc'
|
736
|
+
mutation 'proc { raise }'
|
737
|
+
mutation 'lambda { }'
|
738
|
+
end
|
739
|
+
|
740
|
+
Mutest::Meta::Example.add :send do
|
741
|
+
source 'Proc.new { }'
|
742
|
+
|
743
|
+
singleton_mutations
|
744
|
+
mutation 'Proc.new'
|
745
|
+
mutation 'self.new { }'
|
746
|
+
mutation 'Proc.new { raise }'
|
747
|
+
mutation 'lambda { }'
|
748
|
+
end
|
749
|
+
|
750
|
+
Mutest::Meta::Example.add :send do
|
751
|
+
source 'a =~ //'
|
752
|
+
|
753
|
+
singleton_mutations
|
754
|
+
mutation 'a'
|
755
|
+
mutation 'nil =~ //'
|
756
|
+
mutation 'self =~ //'
|
757
|
+
mutation '//'
|
758
|
+
mutation 'a =~ /nomatch\A/'
|
759
|
+
mutation 'a.match?(//)'
|
760
|
+
end
|
761
|
+
|
762
|
+
Mutest::Meta::Example.add :send do
|
763
|
+
source '//.match(a)'
|
764
|
+
|
765
|
+
singleton_mutations
|
766
|
+
mutation 'a'
|
767
|
+
mutation '//.match'
|
768
|
+
mutation '//.match(nil)'
|
769
|
+
mutation '//.match(self)'
|
770
|
+
mutation '//.match?(a)'
|
771
|
+
mutation '//'
|
772
|
+
mutation '/nomatch\A/.match(a)'
|
773
|
+
end
|
774
|
+
|
775
|
+
Mutest::Meta::Example.add :send do
|
776
|
+
source 'a === b'
|
777
|
+
|
778
|
+
singleton_mutations
|
779
|
+
mutation 'a'
|
780
|
+
mutation 'nil === b'
|
781
|
+
mutation 'self === b'
|
782
|
+
mutation 'b'
|
783
|
+
mutation 'a === nil'
|
784
|
+
mutation 'a === self'
|
785
|
+
mutation 'a.kind_of?(b)'
|
786
|
+
end
|
787
|
+
|
788
|
+
Mutest::Meta::Example.add :send do
|
789
|
+
source 'a.grep(b)'
|
790
|
+
|
791
|
+
singleton_mutations
|
792
|
+
mutation 'a'
|
793
|
+
mutation 'b'
|
794
|
+
mutation 'self.grep(b)'
|
795
|
+
mutation 'a.grep'
|
796
|
+
mutation 'a.grep(nil)'
|
797
|
+
mutation 'a.grep(self)'
|
798
|
+
mutation 'a.grep_v(b)'
|
799
|
+
end
|
800
|
+
|
801
|
+
Mutest::Meta::Example.add :send do
|
802
|
+
source 'a.grep_v(b)'
|
803
|
+
|
804
|
+
singleton_mutations
|
805
|
+
mutation 'a'
|
806
|
+
mutation 'b'
|
807
|
+
mutation 'self.grep_v(b)'
|
808
|
+
mutation 'a.grep_v'
|
809
|
+
mutation 'a.grep_v(nil)'
|
810
|
+
mutation 'a.grep_v(self)'
|
811
|
+
mutation 'a.grep(b)'
|
812
|
+
end
|
813
|
+
|
814
|
+
Mutest::Meta::Example.add :send do
|
815
|
+
source 'select'
|
816
|
+
|
817
|
+
singleton_mutations
|
818
|
+
mutation 'reject'
|
819
|
+
end
|
820
|
+
|
821
|
+
Mutest::Meta::Example.add :send do
|
822
|
+
source 'reject'
|
823
|
+
|
824
|
+
singleton_mutations
|
825
|
+
mutation 'select'
|
826
|
+
end
|
827
|
+
|
828
|
+
Mutest::Meta::Example.add :send do
|
829
|
+
source 'Array(a)'
|
830
|
+
|
831
|
+
singleton_mutations
|
832
|
+
mutation 'a'
|
833
|
+
mutation s(:send, nil, :Array)
|
834
|
+
mutation 'Array(nil)'
|
835
|
+
mutation 'Array(self)'
|
836
|
+
mutation '[a]'
|
837
|
+
end
|
838
|
+
|
839
|
+
Mutest::Meta::Example.add :send do
|
840
|
+
source 'foo.Array(a)'
|
841
|
+
|
842
|
+
singleton_mutations
|
843
|
+
mutation 'a'
|
844
|
+
mutation 'self.Array(a)'
|
845
|
+
mutation 'foo'
|
846
|
+
mutation 'foo.Array'
|
847
|
+
mutation 'foo.Array(nil)'
|
848
|
+
mutation 'foo.Array(self)'
|
849
|
+
end
|