fix(cli): require --round-cap >= 1
This commit is contained in:
@@ -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(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user