<commit_before>require_relative 'test_base'

class ForkBombTest < TestBase

  def self.hex_prefix
    '35758'
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - -
  # fork-bombs from the source
  # - - - - - - - - - - - - - - - - - - - - - - - - - -

  test 'CD5',
  %w( [Alpine] fork-bomb in C fails to go off ) do
    in_kata_as(salmon) {
      content = '#include "hiker.h"' + "\n" + fork_bomb_definition
      run_cyber_dojo_sh({
        changed_files: { 'hiker.c' => content }
      })
    }
    assert_colour 'green'
    assert_stderr ''
    lines = stdout.split("\n")
    assert lines.count{ |line| line == 'All tests passed' } > 42
    assert lines.count{ |line| line == 'fork() => 0' } > 42
    assert lines.count{ |line| line == 'fork() => -1' } > 42
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - -<commit_msg>test refactoring<commit_after>require_relative 'test_base'

class ForkBombTest < TestBase

  def self.hex_prefix
    '35758'
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - -
  # fork-bombs from the source
  # - - - - - - - - - - - - - - - - - - - - - - - - - -

  test 'CD5',
  %w( [Alpine] fork-bomb does not run indefinitely ) do
    in_kata_as(salmon) {
      content = '#include "hiker.h"' + "\n" + fork_bomb_definition
      run_cyber_dojo_sh({
        changed_files: { 'hiker.c' => content }
      })
    }
  end

  # - - - - - - - - - - - - - - - - - - - - - - - - - -
{'fraction_non_alphanumeric': 0.21478382147838215, 'fraction_numerical': 0.01394700139470014, 'mean_word_length': 1.3295454545454546, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6592622', 'n_tokens_mistral': 606, 'n_tokens_neox': 575, 'n_words': 98}