hexchess 2.2.0-alpha.1

A library for Gliński's hexagonal chess, and the brain of hexchess.club
Documentation
use crate::json;
use hexchess::Hexchess;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
struct Test {
    description: String,
    error: bool,
    fen: String,
    result: Option<Hexchess>,
}

#[test]
fn test_hexchess_parse() {
    let tests = json::<Test>("hexchess-parse.json");

    for test in tests {
        let result = Hexchess::parse(&test.fen);

        if test.error {
            assert!(result.is_err(), "{}", test.description);
        } else if test.result.is_some() {
            assert_eq!(result.unwrap(), test.result.unwrap(), "{}", test.description);
        }
    }
}