Skip to content

Commit 2e11c1f

Browse files
committed
chore: add test for confirming instruction files do not exceed line budget
1 parent cfb9a6c commit 2e11c1f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/unittest/test_repo_context.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,16 @@ def test_render_instruction_files_with_line_budget_returns_empty_when_wrapper_ex
269269
assert context == ""
270270

271271

272+
@pytest.mark.parametrize("max_lines", range(0, 12))
273+
def test_render_instruction_files_with_line_budget_never_exceeds_configured_budget(max_lines):
274+
context = render_instruction_files_with_line_budget({
275+
"AGENTS.md": "one\ntwo\nthree",
276+
"CONTRIBUTING.md": "four\nfive",
277+
}, max_lines=max_lines)
278+
279+
assert len(context.splitlines()) <= max_lines
280+
281+
272282
def test_build_repo_context_returns_empty_when_no_files_configured(repo_context_settings):
273283
repo_context_settings.set("CONFIG.REPO_CONTEXT_FILES", [])
274284

0 commit comments

Comments
 (0)