You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: detect CRLF-only string differences and report clear error message
When two strings differ only in line endings (CRLF vs LF), the diff
normalization produces zero hunks, resulting in a confusing empty diff.
Now sameAs detects this case early and fails with a descriptive message
indicating which side uses CRLF vs LF.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: make all CRLF detection branches explicit and tested
Split the catch-all else branch into two specific cases:
- standalone \r characters (neither string contains \r\n)
- mixed CRLF/LF line endings (both strings contain \r\n)
Each branch now has a descriptive message and a dedicated test.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,10 @@ Both developers and AI agents are expected to add entries as they encounter surp
13
13
14
14
## Known gotchas
15
15
16
+
## Testing conventions
17
+
18
+
- Tests use `// given`, `// when`, `// then` comments to structure test cases. Use existing test cases as a reference.
19
+
16
20
## Anti-patterns to avoid
17
21
18
22
- Do not add content to this file that is already discoverable by reading the source or build scripts — that inflates context without adding signal, reducing AI agent task success rates (see [arxiv 2602.11988](https://arxiv.org/abs/2602.11988)).
0 commit comments