core-agent-ide/codex-rs/apply-patch/tests/fixtures/scenarios
Thibault Sottiaux 771f1ca6ab
fix: accept whitespace-padded patch markers (#8746)
Trim whitespace when validating '*** Begin Patch'/'*** End Patch'
markers in codex-apply-patch so padded marker lines parse as intended,
and add regression coverage (unit + fixture scenario); this avoids
apply_patch failures when models include extra spacing. Tested with
cargo test -p codex-apply-patch.
2026-01-05 17:41:23 -08:00
..
001_add_file chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
002_multiple_operations chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
003_multiple_chunks chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
004_move_to_new_directory chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
005_rejects_empty_patch chore(apply-patch) unicode scenario (#8141) 2025-12-16 22:40:22 -08:00
006_rejects_missing_context chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
007_rejects_missing_file_delete chore(apply-patch) unicode scenario (#8141) 2025-12-16 22:40:22 -08:00
008_rejects_empty_update_hunk chore(apply-patch) unicode scenario (#8141) 2025-12-16 22:40:22 -08:00
009_requires_existing_file_for_update chore(apply-patch) unicode scenario (#8141) 2025-12-16 22:40:22 -08:00
010_move_overwrites_existing_destination chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
011_add_overwrites_existing_file chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
012_delete_directory_fails chore(apply-patch) unicode scenario (#8141) 2025-12-16 22:40:22 -08:00
013_rejects_invalid_hunk_header chore(apply-patch) unicode scenario (#8141) 2025-12-16 22:40:22 -08:00
014_update_file_appends_trailing_newline chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
015_failure_after_partial_success_leaves_changes chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
016_pure_addition_update_chunk chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
017_whitespace_padded_hunk_header chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
018_whitespace_padded_patch_markers chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
019_unicode_simple chore(apply-patch) unicode scenario (#8141) 2025-12-16 22:40:22 -08:00
020_delete_file_success chore(apply-patch) additional scenarios (#8230) 2026-01-05 15:56:38 -08:00
020_whitespace_padded_patch_marker_lines fix: accept whitespace-padded patch markers (#8746) 2026-01-05 17:41:23 -08:00
021_update_file_deletion_only chore(apply-patch) additional scenarios (#8230) 2026-01-05 15:56:38 -08:00
022_update_file_end_of_file_marker chore(apply-patch) additional scenarios (#8230) 2026-01-05 15:56:38 -08:00
.gitattributes chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00
README.md chore(apply-patch) scenarios for e2e testing (#7567) 2025-12-05 00:20:54 +00:00

Overview

This directory is a collection of end to end tests for the apply-patch specification, meant to be easily portable to other languages or platforms.

Specification

Each test case is one directory, composed of input state (input/), the patch operation (patch.txt), and the expected final state (expected/). This structure is designed to keep tests simple (i.e. test exactly one patch at a time) while still providing enough flexibility to test any given operation across files.

Here's what this would look like for a simple test apply-patch test case to create a new file:

001_add/
  input/
    foo.md
  expected/
    foo.md
    bar.md
  patch.txt