fix(cli): require --round-cap >= 1

This commit is contained in:
2026-09-20 17:40:29 +02:00
parent 10f811e80e
commit c46e636d12
3 changed files with 47 additions and 2 deletions
+42
View File
@@ -84,6 +84,48 @@ def test_cli_rejects_duplicate_side_names(capsys: pytest.CaptureFixture[str]) ->
assert "players" in err
def test_cli_rejects_negative_round_cap(capsys: pytest.CaptureFixture[str]) -> None:
rc = main(
[
"--map",
str(MAP),
"--side",
"players",
str(GOBLIN),
"--side",
"monsters",
str(ORC),
"--runs",
"10",
"--round-cap",
"-3",
]
)
assert rc == 2
assert "--round-cap must be >= 1" in capsys.readouterr().err
def test_cli_rejects_zero_round_cap(capsys: pytest.CaptureFixture[str]) -> None:
rc = main(
[
"--map",
str(MAP),
"--side",
"players",
str(GOBLIN),
"--side",
"monsters",
str(ORC),
"--runs",
"10",
"--round-cap",
"0",
]
)
assert rc == 2
assert "--round-cap must be >= 1" in capsys.readouterr().err
def test_cli_transcript_prints_first_battle_log(capsys: pytest.CaptureFixture[str]) -> None:
rc = main(
[