Commit ee5cf161 authored by Keisuke ANDO's avatar Keisuke ANDO 😌
Browse files

[update] close #4, close #3, close #2; RPackage化

parent b28e230f
# This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/tests.html
# * https://testthat.r-lib.org/reference/test_package.html#special-files
library(testthat)
library(socceR)
test_check("socceR")
test_that("Read rcl file without error", {
expect_no_error(read_log(test_path("20220405162804-HELIOS_base_3-vs-enemy_2.rcl")))
})
test_that("Read rcg file without error", {
expect_no_error(read_log(test_path("20220405162804-HELIOS_base_3-vs-enemy_2.rcg")))
})
test_that("All items in rcg file must be retained", {
rcg <- read_log(test_path("20220405162804-HELIOS_base_3-vs-enemy_2.rcg"))
expect_true("header" %in% names(rcg))
expect_true("server_param" %in% names(rcg))
expect_true("player_param" %in% names(rcg))
expect_true("player_type" %in% names(rcg))
expect_true("team" %in% names(rcg))
expect_true("show" %in% names(rcg))
expect_true("msg" %in% names(rcg))
})
test_that("Do not read file that is not log file", {
expect_error(read_log(test_path("not_log_file.txt")))
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment