Commit 9cd4cdf
[analyzer] Fix failing ParameterListTest cases.
These test cases were broken by
https://dart-review.googlesource.com/c/sdk/+/252566 and were marked
with `@failingTest`.
The reason for the breakage was that the aforementioned CL changed the
implementation of `AstComparator.visitSimpleFormalParameter` so that
it compared the parameter's names using `isEqualTokens` rather than
`isEqualNodes`. When this logic is used by `ParameterListTest`,
`isEqualTokens` and `isEqualNodes` are being overridden by methods in
the derived class `ResultComparator`, and one of the special behaviors
of `ResultComparator.isEqualNodes` is to allow the simple identifier
`_k_` to be substituted for a keyword token.
To fix the test, this special behavior needs to be moved from
`ResultComparator.isEqualNodes` to `ResultComparator.isEqualTokens`.
This paves the way for a follow-up CL in which I plan to rewrite
`ResultComparator` so that it doesn't depend on `AstComparator`; that
in turn will allow `AstComparator` to be rmoved.
Change-Id: I8434c7c694e1e5c613df62bf34ee69126fb0c2ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418900
Reviewed-by: Konstantin Shcheglov <[email protected]>
Auto-Submit: Paul Berry <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>1 parent 36faa9a commit 9cd4cdf
File tree
2 files changed
+7
-8
lines changed- pkg/analyzer/test/src/fasta/recovery
2 files changed
+7
-8
lines changedLines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
568 | | - | |
569 | 568 | | |
570 | 569 | | |
571 | 570 | | |
| |||
580 | 579 | | |
581 | 580 | | |
582 | 581 | | |
583 | | - | |
584 | 582 | | |
585 | 583 | | |
586 | 584 | | |
| |||
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
141 | 138 | | |
142 | 139 | | |
143 | 140 | | |
144 | 141 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
0 commit comments