Files
pokerfreak/mac/Tests/Pruefung/ServerStartSpec.swift
T
mmintel 9c79d8236b Acceptance 5.11.: channel play without AFK, quiet focus, working Cockpit, stronger play
- Practice tables: 20-min session 54/54 turns at the server, control session 28 turns,
  0 timeouts; stage: 3 tables, two rounds each, clean teardown.
- Never let the clock run: an engine abstention becomes check or fold (nie_verstreichen).
- Mittler join in a fixed order (kill the duplicate, then announce), a mittler ends with its
  game, the laufwache opens no tables, stop waits for the runner to stand up.
- Focus: no lobby connections from HUD, probes or layout; "Focus Window on Turn" off.
- Tables: disconnected or sitting-out opponents do not count; a table without channel is
  closed and avoided after 45 s; the join event keeps the writer's pid (strict invariants).
- Geldwache: same room list as the runner, the table's own report, stand up before closing.
- Engine: the small blind completes the top 65 % against limpers (price per fair share);
  the calling range of a bet is as wide as the villain calls - value bets into stations.
- Cockpit: the source tree never comes from SHELL; one operating set for laufwache and
  Cockpit (sicht/start.py --client, ServerStart).
- Project lives in ~/Projects/pokerfreak (kern was a detour).
2026-11-05 16:10:43 +01:00

35 lines
1.5 KiB
Swift

import CockpitKern
import Testing
@Suite("ServerStart: das Cockpit startet seine Datenschicht am Client oder am Klon")
struct ServerStartSpec {
@Test("am Client mit --client - und nie CLIENT=0, das heisst an der Naht Klon (5.11.)")
func amClient() {
#expect(ServerStart.befehl(klon: false, uebernehmen: false).contains(" --client"))
#expect(ServerStart.umgebung(["CLIENT": "0", "HOME": "/h"])["CLIENT"] == nil)
}
@Test("am Klon ohne --client, und ein CLIENT aus der Umgebung faellt weg")
func amKlon() {
#expect(!ServerStart.befehl(klon: true, uebernehmen: false).contains("--client"))
#expect(ServerStart.umgebung(["CLIENT": "1"])["CLIENT"] == nil)
}
@Test("die uebrige Umgebung bleibt, wie sie ist")
func rest() {
#expect(ServerStart.umgebung(["HOME": "/h", "CLIENT": "1", "PATH": "/p"]) == ["HOME": "/h", "PATH": "/p"])
}
@Test("ablösen haengt --uebernehmen an")
func uebernehmen() {
#expect(ServerStart.befehl(klon: false, uebernehmen: true).hasSuffix(" --uebernehmen"))
#expect(!ServerStart.befehl(klon: false, uebernehmen: false).contains("--uebernehmen"))
}
@Test("der Befehl startet das Skript aus $0 als App")
func form() {
#expect(ServerStart.befehl(klon: true, uebernehmen: false) == "exec python3 -u \"$0\" --art App")
#expect(ServerStart.befehl(klon: false, uebernehmen: true) == "exec python3 -u \"$0\" --art App --client --uebernehmen")
}
}