Sha256: 3f93872017f5e7c9c695367de080b84192c0d7a8cdcce7f6dd947781f3875235

Contents?: true

Size: 985 Bytes

Versions: 2

Compression:

Stored size: 985 Bytes

Contents

require 'test_helper'


class EngineTest < Minitest::Test

  def setup
		@klass = Stockfish::Engine
  end

  def test_engine_version_is_valid
    assert @klass.new.version[/^Stockfish \d+/]
  end

  def test_engine_is_ready?
    assert @klass.new.ready?
  end

  def test_engine_returns_position_analysis
    fen = read_fixture("positions/stalemate.txt")
    analysis_output = @klass.new.analyze(fen, { :depth => 6 })
    assert analysis_output[/^info/]
    assert analysis_output[/^bestmove/]
    fen = read_fixture("positions/start.txt")
    analysis_output = @klass.new.analyze(fen, { :depth => 6 })
    assert analysis_output[/^info/]
    assert analysis_output[/^bestmove/]
  end

  def test_multipv_mode_returns_multipv_output
    engine = @klass.new
    engine.multipv(3)
    fen = read_fixture("positions/white_wins_in_4.txt")
    analysis_output = engine.analyze(fen, { :depth => 6 })
    assert analysis_output[/multipv 3/]
    assert analysis_output[/^bestmove/]
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stockfish-0.3.1 test/engine_test.rb
stockfish-0.3.0 test/engine_test.rb