Sha256: a872c9c3cce00702cb5136f1200ba44593ffaed020ce9a1fc194888e7fe74ad0

Contents?: true

Size: 578 Bytes

Versions: 3

Compression:

Stored size: 578 Bytes

Contents

require 'test_helper'

class ChessTest < Minitest::Test
  if ENV['BIG_PGN_COLLECTION'] && File.exist?(TestHelper::BIG_PGN_COLLECTION)
    puts 'Loading tests for a big PGN collection...'
    300_000.times do |i|
      filename = format('%06d.pgn', i + 1)
      path = File.join(TestHelper::BIG_PGN_COLLECTION, filename)
      break unless File.exist?(path)

      define_method :"test_big_pgn_#{filename}" do
        pgn = Chess::Pgn.new(path)
        game = Chess::Game.new(pgn.moves)
        assert(game.checkmate?) if pgn.moves.last.match?(/\#$/)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chess-0.4.0 test/test_big_pgn_collection.rb
chess-0.3.6 test/test_big_pgn_collection.rb
chess-0.3.5 test/test_big_pgn_collection.rb