Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,18 @@ def test_turns_are_monotonic(claude_jsonl, codex_session, openai_chat):
turn_indices = [t.index for t in s.turns]
assert turn_indices == sorted(turn_indices)
assert turn_indices[0] == 1


def test_empty_transcript_raises_parse_error():
"""Empty / whitespace-only input is a parse error, not a silent zero-turn session."""
with pytest.raises(ParseError, match="could not detect|no messages|invalid"):
parse_text("")
with pytest.raises(ParseError, match="could not detect|no messages|invalid"):
parse_text(" \n\t\n ")


def test_claude_jsonl_empty_file_raises(tmp_path):
p = tmp_path / "empty.jsonl"
p.write_text("")
with pytest.raises(ParseError):
parse_file(p)
Loading