<commit_before>module Byebug
  #
  # Custom interface for easier assertions
  #
  class TestInterface < Interface
    attr_accessor :test_block

    def initialize
      super()
      @input, @output, @error = [], [], []
    end

    def errmsg(message)
      error.push(message)
    end

    def read_command(prompt)
      return readline(prompt, true) unless input.empty?

      return unless test_block

      test_block.call
      self.test_block = nil
    end

    def puts(message)
      output.push(message)
    end

    def inspect<commit_msg>More flexible "puts" interface method<commit_after>module Byebug
  #
  # Custom interface for easier assertions
  #
  class TestInterface < Interface
    attr_accessor :test_block

    def initialize
      super()
      @input, @output, @error = [], [], []
    end

    def errmsg(message)
      error.push(message)
    end

    def read_command(prompt)
      return readline(prompt, true) unless input.empty?

      return unless test_block

      test_block.call
      self.test_block = nil
    end

    def puts(message)
      output.push(message.to_s)
    end

    def inspect
{'fraction_non_alphanumeric': 0.08045977011494253, 'fraction_numerical': 0.0, 'mean_word_length': 2.493827160493827, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2219723', 'n_tokens_mistral': 350, 'n_tokens_neox': 329, 'n_words': 89}