Skip to content

Commit

Permalink
Forgot to commit new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clente committed May 3, 2021
1 parent 704918d commit ce624a6
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions tests/testthat/test-fish.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
test_that("engine works", {

# Detect Mac
is_mac <- function() {
grepl("Darwin", Sys.info()["sysname"])
}

# Find executable
expect_type(fish_find(), "character")

Expand All @@ -13,11 +8,8 @@ test_that("engine works", {
expect_true(engine$process$is_alive())
expect_gt(engine$process$get_pid(), 0)

# Test startup message (if not on Mac, because it doesn't always show up)
if (!is_mac()) {
expect_true(grepl("Stockfish 11", engine$output))
expect_true(engine$isready())
}
# Test startup message
expect_true(engine$isready())

# Test command
expect_equal(utils::tail(engine$uci(), 1), "uciok")
Expand All @@ -33,8 +25,7 @@ test_that("engine works", {

# Test more commands
expect_output(print(engine), "PROCESS")
tmp <- engine$position("e2e4", "startpos")
expect_true(is.null(tmp) || grepl("Stockfish 11", tmp))
engine$position("e2e4", "startpos")
expect_equal(engine$ucinewgame(), "readyok")
expect_null(engine$setoption("Clear Hash"))
expect_length(engine$go(depth = 10, movetime = 1000), 1)
Expand Down

0 comments on commit ce624a6

Please sign in to comment.