File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,9 +56,8 @@ def encode(p: Payload) -> str:
5656 if e .status and e .status != "unchanged" :
5757 line += f" { e .status } "
5858 edge_lines .append (line )
59- if edge_lines :
60- parts .append ("## edges" )
61- parts .extend (edge_lines )
59+ parts .append ("## edges" )
60+ parts .extend (edge_lines )
6261
6362 return "\n " .join (parts ) + "\n "
6463
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ def test_encode_edge_unchanged_status_omitted():
163163
164164
165165def test_encode_skips_edges_with_missing_symbols ():
166- """Edges referencing symbols not in the payload are skipped ."""
166+ """Edges referencing unknown symbols are skipped, but section header emitted ."""
167167 p = Payload (
168168 tool = "test" ,
169169 symbols = [
@@ -174,7 +174,10 @@ def test_encode_skips_edges_with_missing_symbols():
174174 ],
175175 )
176176 output = encode (p )
177- assert "## edges" not in output
177+ # Section header is emitted (matches Go), but no edge lines beneath it
178+ assert "## edges" in output
179+ lines_after_edges = output .split ("## edges\n " )[1 ]
180+ assert lines_after_edges .strip () == ""
178181
179182
180183def test_encode_empty_payload ():
You can’t perform that action at this time.
0 commit comments