using MuZero
using Test

include("state.jl")
include("game.jl")

@testset "TicTacToeState" begin
    s = TicTacToeState()
    @test legal_actions(s)  |> (x) -> issetequal(x, collect(1:9))
    @test dynamics(s, 1)    |> (x) -> isa(x, Tuple{Float32, TicTacToeState})
    @test is_terminal(s)    |> typeof == Bool
    @test to_image(s)       |> typeof == Array{Float32, 3}
    @test svg(s)            |> typeof == TicTacToeStateSVG
    #@test png(s)            |> typeof == TicTacToeStatePNG
end