Commit 6aaed0a
Print toplevel unbound names if sources unequal but statements identical
Summary:
A huge pain point for me when trying to debug a diff was running into tests that compared sources, where the two sources were ostensibly identical based on the test output and the printed diff between expected and actual was empty.
It turned out that sometimes the top level unbound names were different in the source, sometimes there was some statement node nested deep into the source that had some metadata that was different, etc.
It would have saved me a lot of time and print debugging if the source equality testing function could tell when it was not going to print any helpful output around why this test was failing, and adjust to print something useful instead.
Decided to implement this and land it - for now, if the sources are not equal even without counting the statements in the body, print the pretty json and compare that. Otherwise, just do the normal printing. Can be modified to maybe do pretty printing more aggressively if trying to debug in the future and something still seems to show no difference.
Reviewed By: grievejia
Differential Revision: D30213681
fbshipit-source-id: 6a9447f0301858c121e8a2ee98a7d3cc151445861 parent e40e8c2 commit 6aaed0a
3 files changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
252 | 258 | | |
253 | 259 | | |
254 | 260 | | |
255 | | - | |
| 261 | + | |
256 | 262 | | |
257 | 263 | | |
258 | 264 | | |
| |||
0 commit comments