From df9085265fc63f036573598eff245dbda4c40df8 Mon Sep 17 00:00:00 2001 From: cristianchiriac <80774326+cristianchiriac@users.noreply.github.com> Date: Thu, 8 Oct 2026 07:45:20 +0300 Subject: [PATCH] test(core): write the indexed-bytes test note with LF newlines write_text() translates "\n" to "\r\n" on Windows, so the note on disk was 11 bytes longer than NOTE_CONTENT and both tests in test_indexed_bytes_work_units.py failed on the Windows CI job (assert 204 == 193). Write the note with newline="\n" so its bytes, size and checksum match NOTE_CONTENT on every platform. Signed-off-by: cristianchiriac <80774326+cristianchiriac@users.noreply.github.com> --- test-int/test_indexed_bytes_work_units.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test-int/test_indexed_bytes_work_units.py b/test-int/test_indexed_bytes_work_units.py index b6379ad49..daa0cfaf4 100644 --- a/test-int/test_indexed_bytes_work_units.py +++ b/test-int/test_indexed_bytes_work_units.py @@ -36,7 +36,8 @@ async def test_batch_index_reports_bytes_indexed_and_zero_for_current_file( ) -> None: path = "notes/billing-note.md" (project_config.home / "notes").mkdir(parents=True, exist_ok=True) - (project_config.home / path).write_text(NOTE_CONTENT, encoding="utf-8") + # newline="\n" keeps the file's bytes equal to NOTE_CONTENT on Windows too + (project_config.home / path).write_text(NOTE_CONTENT, encoding="utf-8", newline="\n") expected_bytes = len(NOTE_CONTENT.encode("utf-8")) runtime = await LocalProjectIndexRuntimeFactory().runtime_for_project(test_project) # The observed checksum lets the checker compare against the index and @@ -76,7 +77,7 @@ async def test_single_file_index_reports_bytes_indexed( ) -> None: path = "notes/billing-note.md" (project_config.home / "notes").mkdir(parents=True, exist_ok=True) - (project_config.home / path).write_text(NOTE_CONTENT, encoding="utf-8") + (project_config.home / path).write_text(NOTE_CONTENT, encoding="utf-8", newline="\n") dependencies = await LocalProjectIndexRuntimeFactory().dependencies_for_project(test_project) result = await dependencies.file_indexer.index_file(path, source="index")