tests/testthat/test-get_moves.R

test_that('get_moves gets moves', {
  expect_identical(
    get_moves(c('1. e4 e5', '1. h3 h6')),
    list(c('e2e4', 'e7e5'), c('h2h3', 'h7h6'))
  )
})

test_that('get_moves handles empty movetext', {
  movetext <- c('1. e4 e5', '', '1. h3 h6', '')
  expect_identical(
    get_moves(movetext),
    list(c('e2e4', 'e7e5'), c(''), c('h2h3', 'h7h6'), c(''))
  )
})
dryguy/rbitr documentation built on Oct. 15, 2024, 6:18 a.m.