Unified Diff - No Newline Marker on the Old Side Only
The before-state has no final newline and the after-state gains one, so the marker appears once, immediately after the last `-` line. The change is invisible in a rendered side-by-side view yet alters the file's bytes, which is why line-based comparators report a spurious no-op.
--- a/RELEASE-NOTES 2026-03-02 09:14:03.000000000 +0000
+++ b/RELEASE-NOTES 2026-03-02 10:41:55.000000000 +0000
@@ -2,4 +2,4 @@
-----------------
1. Freeze main.
2. Cut the tag.
-3. Publish the notes.
\ No newline at end of file
+3. Publish the notes.
Specifications
- Seed
- 20260807
- Diff Format
- unified
- Files
- 1
- Marker
- \ No newline at end of file
- Marker Count
- 1
- Side
- old
- Line Endings
- LF
- Encoding
- UTF-8
Testing contract
Expected to pass- Scenario
- Apply a diff whose only change is that the file gains a trailing newline.
- Expected result
- RELEASE-NOTES grows by exactly one byte (0x0A) and the marker line is not written into the file.
What is a .diff file?
A .diff file records the difference between two versions of one or more text files. The unified format — the default almost everywhere — names the old and new files on `---` and `+++` lines, then lists hunks introduced by `@@ -old,count +new,count @@` in which context lines are unprefixed and changed lines are prefixed with `-` or `+`. Older context and normal diff formats exist but are rarely produced today.
How to use this file
Use an example .diff file to test diff parsers, syntax highlighters, and merge tooling — verifying hunk-offset arithmetic, correct handling of context lines that begin with a space, and behaviour on files whose changes include trailing-whitespace or line-ending differences.
How to use this file for testing
“Unified Diff - No Newline Marker on the Old Side Only” is a deterministic Novus Examples fixture for Visual diff / regression, Code parsing, Editor testing. A/B image twins with controlled pixel changes, anti-alias variants, and UI chrome crops for screenshot diff and visual regression tools.
Documented properties for this file: seed 20260807 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Diff and patch fixtures name their target paths and the exact edge case they exercise — rename, mode change, binary hunk, CRLF↔LF, or missing trailing newline. Apply or render them against the documented before-state; every author, path, and hash is fictional.
Treat A/B twins as a visual regression unit: run your pixel or perceptual diff, assert a non-zero delta on the changed twin, and keep thresholds calibrated against the documented change kind in specs.
Related files
- diffUnified Diff - Bare Line Number in the Hunk HeaderA one-line file changed in place. Both ranges have length one, so the header is written `@@ -1 +1 @@` with no comma and no count — the abbreviation the unified format allows and that regexes of the form `-(\d+),(\d+)` fail to match.

- diffUnified Diff - Deleted File Against /dev/nullThe mirror of the added-file fixture: every line is a deletion and the new range is `+0,0`. A renderer that writes an empty file instead of unlinking it, or that reports the change as a truncation, fails this one.

- diffUnified Diff - Function Heading After the Hunk Headergit appends the enclosing declaration after the closing `@@` of each hunk header. The text is free-form and is not part of the range, so a parser that splits the header on `@@` and takes the last field reads the function signature as a range.

- diffUnified Diff - New File Against /dev/nullA file created from nothing: the old side is `/dev/null` and the hunk header carries the zero-length range `-0,0`. Parsers that compute a 1-based start line from the old range produce line 1 instead of line 0 unless they special-case a zero count.

- diffUnified Diff - Reverse of the Single-Hunk DiffThe exact inverse of the single-hunk fixture: the same edit expressed as a deletion instead of an insertion. Applying both in sequence must return the file to its original bytes, which makes this the fixture for `patch -R` and for revert paths.

- diffUnified Diff - Several Hunks in One FileOne TypeScript module edited in 2 places at once, so the hunks are far enough apart not to merge. Use it to check that a parser advances its line cursor by the hunk header rather than by counting emitted lines.

Generated by generation/version_control.py. Free for any use, no attribution required — license.