Commit 8ef0b67
committed
Fix grepdiff --status test expectations
The previous test expected '!' for all matching files, but this is
incorrect according to the grepdiff(1) documentation.
The -s/--status flag should show:
+ for file additions (old file is /dev/null)
- for file removals (new file is /dev/null)
! for file modifications (both files exist)
This matches the behavior documented for both grepdiff and lsdiff.
The legacy filterdiff implementation in --grep mode has a bug where it
always shows '!' regardless of the actual file operation. This test now
correctly verifies the documented behavior.
The test now comprehensively checks all three status indicators:
- First test (pattern 'content'): verifies +, -, and !
- Second test (pattern 'new'): verifies ! for modifications
- Third test (with --empty-files-as-absent): verifies that empty files
with only additions are treated as new files and show +
Note: The implementation does not yet pass these tests. The fixes will
come in a later commit.
Assisted-by: Claude Code1 parent 7e30407 commit 8ef0b67
1 file changed
+35
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
22 | 31 | | |
23 | 32 | | |
| 33 | + | |
24 | 34 | | |
25 | 35 | | |
26 | 36 | | |
27 | 37 | | |
28 | | - | |
29 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
30 | 41 | | |
31 | 42 | | |
32 | | - | |
| 43 | + | |
33 | 44 | | |
34 | 45 | | |
35 | 46 | | |
36 | 47 | | |
37 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
38 | 69 | | |
0 commit comments