<commit_before># frozen_string_literal: true
require_relative 'test_base'

class ServerProcessAdapterTest < TestBase

  def self.id58_prefix
    'h9U'
  end

  # - - - - - - - - - - - - - - - - - - - - -

  test 'S3e', %w(
  a simple object-wrapper to allow instance-level stubbing
  ) do
    processor = ProcessAdapter.new
    pid = processor.spawn('sleep 10', {})
    processor.detach(pid)
    processor.kill(:TERM, pid)
  end

end<commit_msg>Update process-adapter test<commit_after># frozen_string_literal: true
require_relative 'test_base'

class ServerProcessAdapterTest < TestBase

  def self.id58_prefix
    'h9U'
  end

  # - - - - - - - - - - - - - - - - - - - - -

  test 'S3e', %w(
  a simple object-wrapper to allow instance-level stubbing
  ) do
    r,w = IO.pipe
    processor = ProcessAdapter.new
    pid = processor.spawn('printf hello', out:w)
    w.close
    echoed = r.read
    processor.detach(pid)
    processor.kill(:TERM, pid)
    assert_equal 'hello', echoed
  end

end
{'fraction_non_alphanumeric': 0.12977867203219315, 'fraction_numerical': 0.01006036217303823, 'mean_word_length': 2.491228070175439, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5546237', 'n_tokens_mistral': 359, 'n_tokens_neox': 347, 'n_words': 76}