<commit_before>module Assert
  class Runner

    # a Runner runs a suite of tests.

    def initialize(suite, view)
      raise ArgumentError if !suite.kind_of?(Suite)
      @suite = suite
      @view = view
    end

    def run(*args)
      @suite.setup
      @view.render do
        benchmark { run_suite }
      end
      @suite.teardown
      count(:failed) + count(:errored)
    end

    def count(type)
      @suite.count(type)
    end

    protected

    def tests_to_run
      tests = @suite.tests

      # order tests randomly
      max = tests.size
      srand
      seed = srand % 0xFFFF
      srand seed
      tests.sort.sort_by { rand max }
      tests
    end<commit_msg>tests actual run randomly now - every time - regardless of test size<commit_after>module Assert
  class Runner

    # a Runner runs a suite of tests.

    def initialize(suite, view)
      raise ArgumentError if !suite.kind_of?(Suite)
      @suite = suite
      @view = view
    end

    def run(*args)
      @suite.setup
      @view.render do
        benchmark { run_suite }
      end
      @suite.teardown
      count(:failed) + count(:errored)
    end

    def count(type)
      @suite.count(type)
    end

    protected

    def tests_to_run
      tests = @suite.tests

      # order tests randomly
      max = tests.size
      srand
      seed = srand % 0xFFFF
      srand seed
      tests.sort.sort_by { rand max }
    end
{'fraction_non_alphanumeric': 0.07643312101910828, 'fraction_numerical': 0.0014154281670205238, 'mean_word_length': 1.8857142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6159878', 'n_tokens_mistral': 448, 'n_tokens_neox': 431, 'n_words': 128}