Commit 29e97f8
committed
gopls/internal/marker: make checkDiffs less fragile
The marker tests make over 500 calls to checkDiffs, which currently
works by computing line diffs between the before code and the after code
and comparing these with the unified diffs that are
the golden contents in the test .txt file.
This is fragile, as a different diff algorithm would produce
different diffs, and we would like to remove the dependency on
myers.ComputeEdit.
This CL instead just checks that the unified golden diffs correctly
convert the before code into the after code. (Note that this
is a complete test of the new code on all existing uses in marker
tests.)
A subsequent CL will replace myers.ComputeEdit.
Change-Id: Iabf6659a646bd69730d8ae19b1d46885a4903d90
Reviewed-on: https://go-review.googlesource.com/c/tools/+/724660
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>1 parent 1f3446a commit 29e97f8
File tree
2 files changed
+77
-23
lines changed- gopls/internal/test/marker
- internal/diff
2 files changed
+77
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1458 | 1458 | | |
1459 | 1459 | | |
1460 | 1460 | | |
1461 | | - | |
1462 | | - | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
1463 | 1465 | | |
1464 | | - | |
1465 | 1466 | | |
1466 | 1467 | | |
1467 | | - | |
1468 | | - | |
1469 | | - | |
1470 | | - | |
1471 | | - | |
1472 | | - | |
1473 | | - | |
1474 | | - | |
1475 | | - | |
1476 | | - | |
1477 | 1468 | | |
1478 | 1469 | | |
1479 | 1470 | | |
1480 | 1471 | | |
1481 | 1472 | | |
1482 | 1473 | | |
1483 | 1474 | | |
| 1475 | + | |
1484 | 1476 | | |
| 1477 | + | |
1485 | 1478 | | |
1486 | | - | |
| 1479 | + | |
1487 | 1480 | | |
1488 | | - | |
| 1481 | + | |
1489 | 1482 | | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
1494 | 1486 | | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
1499 | 1502 | | |
1500 | 1503 | | |
| 1504 | + | |
1501 | 1505 | | |
1502 | 1506 | | |
1503 | 1507 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
249 | 251 | | |
250 | 252 | | |
251 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
0 commit comments