<commit_before># frozen_string_literal: true

module Mutant
  module Meta
    class Example
      # Example verification
      class Verification
        include Adamantium::Flat, Concord.new(:example, :mutations)

        # Test if mutation was verified successfully
        #
        # @return [Boolean]
        def success?
          missing.empty? && unexpected.empty? && no_diffs.empty?
        end

        # Error report
        #
        # @return [String]
        def error_report
          fail 'no error report on successful validation' if success?

          YAML.dump(
            'file'            => example.file,
            'original_ast'    => example.node.inspect,<commit_msg>Refactor example verification duplication<commit_after># frozen_string_literal: true

module Mutant
  module Meta
    class Example
      # Example verification
      class Verification
        include Adamantium::Flat, Concord.new(:example, :mutations)

        # Test if mutation was verified successfully
        #
        # @return [Boolean]
        def success?
          [missing, unexpected, no_diffs].all?(&:empty?)
        end

        # Error report
        #
        # @return [String]
        def error_report
          fail 'no error report on successful validation' if success?

          YAML.dump(
            'file'            => example.file,
            'original_ast'    => example.node.inspect,
{'fraction_non_alphanumeric': 0.08014184397163121, 'fraction_numerical': 0.0, 'mean_word_length': 1.9518828451882846, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '117134', 'n_tokens_mistral': 369, 'n_tokens_neox': 355, 'n_words': 104}