mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
Count distinct users with a session token valid within the 14-day window and use it for the hero players-training stat. The learning strip keeps the total player count. Also load the split seed modules in seeds_test and drop an invalid 8-piece seed FEN so precommit passes.
27 lines
867 B
Elixir
27 lines
867 B
Elixir
defmodule Chesstrainer.SeedsTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
alias Chesstrainer.FEN
|
|
|
|
Code.require_file("../../priv/repo/seeds/endgames/win.ex", __DIR__)
|
|
Code.require_file("../../priv/repo/seeds/endgames/draw.ex", __DIR__)
|
|
Code.require_file("../../priv/repo/seeds/endgames.ex", __DIR__)
|
|
|
|
describe "seed endgames" do
|
|
test "are normalised and within tablebase range" do
|
|
for endgame <- Chesstrainer.Repo.Seeds.Endgames.all() do
|
|
fen = FEN.normalize(endgame.fen)
|
|
|
|
assert length(String.split(fen, " ")) == 6,
|
|
"seed FEN must have 6 fields: #{endgame.fen}"
|
|
|
|
refute String.ends_with?(fen, " 0"),
|
|
"seed FEN keeps fullmove 0 after normalisation: #{endgame.fen}"
|
|
|
|
assert FEN.piece_count(fen) <= 7,
|
|
"seed FEN has more than 7 pieces: #{endgame.fen}"
|
|
end
|
|
end
|
|
end
|
|
end
|