Sha256: af26d01ae99d1e8c115c11e900503f4d3bb8aaa7d8fc6dddcfcd01f01f404ec2

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 Bytes

Contents

# frozen_string_literal: true

module AtCoderFriends
  # run test cases for the specified program with sample input/output.
  class SampleTestRunner < TestRunner
    include PathUtil

    def initialize(path, config)
      super(path, config)
      @smp_dir = smp_dir(@dir)
    end

    def test_all
      puts "***** test_all #{@prg} *****"
      1.upto(999) do |i|
        break unless test(i)
      end
    end

    def test_one(n)
      puts "***** test_one #{@prg} *****"
      test(n)
    end

    def test(n)
      id = format('%<q>s_%<n>03d', q: @q, n: n)
      files = %w[in out exp].map { |ext| "#{@smp_dir}/#{id}.#{ext}" }
      run_test(id, *files)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
at_coder_friends-0.4.0 lib/at_coder_friends/sample_test_runner.rb