Commit 16ed41d
authored
fix: enable dyff rename detection when --find-renames is set (#980)
* fix: enable dyff rename detection when --find-renames is set
The condition guarding dyff.DetectRenames(true) was inverted: it
enabled rename detection only when FindRenames was NOT set (<= 0) and
disabled it when the user explicitly requested it via --find-renames.
Flip the condition from <= 0 to > 0 so that dyff's rename detection
is enabled when --find-renames is set to any positive value, matching
the documented behavior.
Fixes #976
Signed-off-by: yxxhero <aiopsclub@163.com>
* fix: propagate FindRenames to Report and update tests
Pass FindRenames from Options to Report so that printDyffReport can
use it to conditionally enable dyff.DetectRenames. Update test name
and add FindRenames field to test reports for consistency.
Signed-off-by: yxxhero <aiopsclub@163.com>
* fix: preserve FindRenames in doSuppress and add regression test
Copy FindRenames into the filtered report in doSuppress so that
--find-renames still works when --suppress-output-line-regex is used.
Add TestPrintDyffReportFindRenamesChangesOutput to verify that dyff
output differs between FindRenames == 0 and FindRenames > 0.
Signed-off-by: yxxhero <aiopsclub@163.com>
* refactor: make Report.findRenames unexported and improve tests
Make findRenames an unexported field on Report since it is internal
state for dyff printing, not part of the public API.
Rename TestPrintDyffReportDoesNotMergeAddRemoveWithFindRenames to
TestPrintDyffReportAddRemoveDiffersFromModify for clarity.
Replace the brittle NotEqual assertion in the rename detection test
with specific assertions on stable dyff output markers (presence of
'one document removed/added' vs 'value change') to reliably verify
that rename detection is toggled by findRenames.
Signed-off-by: yxxhero <aiopsclub@163.com>
---------
Signed-off-by: yxxhero <aiopsclub@163.com>1 parent a2a9488 commit 16ed41d
3 files changed
Lines changed: 63 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
167 | 218 | | |
168 | 219 | | |
169 | 220 | | |
| |||
0 commit comments