v0.13.1 concession management and record, clients update, version report
test / test (push) Canceled after 0s

This commit is contained in:
lixen committed 2026-09-29 02:09:45 -04:00
1 parent f1ac4cbbe7
commit 6e8d80c788
30 files changed
+704 -81

No files matched your search

+21
View File
@@ -154,3 +154,24 @@ func TestBuildPGN(t *testing.T) {
t.Error("ply beyond the line accepted")
}
}
// A resignation taken back by an undo is noted before the live result.
func TestBuildPGNNotesContinuedConcession(t *testing.T) {
moves := stored(t, chess.StartFEN, "e2e4", "e7e5", "d2d4")
rec := record(chess.StartFEN, "", "")
rec.ConcessionResult, rec.ConcessionTermination, rec.ConcessionPly = "black_wins", "resignation", 2
pgn, err := BuildPGN(rec, moves, -1)
if err != nil {
t.Fatal(err)
}
if !strings.HasSuffix(pgn.Text, "\n\n1. e4 e5 2. d4 { White resigned at ply 2; play continued. } *\n") {
t.Errorf("continued game:\n%s", pgn.Text)
}
// The concession that is still the result needs no note.
rec.Result, rec.Termination, rec.ConcessionPly = "black_wins", "resignation", 3
if pgn, _ = BuildPGN(rec, moves, -1); strings.Contains(pgn.Text, "continued") {
t.Errorf("standing resignation noted as continued:\n%s", pgn.Text)
}
}