[analyzer] Consolidate more helpers in evaluation_test.

Added helpers `_field` and `_localVar` to allow tests to test their final fields and local const variables in the const tests.

The rest of the CL moves away from `_evaluateConstant` helpers (to avoid recomputing constants), to `_topLevelVar` or equivalent helpers which grabs the existing evaluation result.

This CL adds to the goal making all constant tests consistent and to avoid unnecessary const computations in the tests.

Change-Id: I508483714a51e5d060286256657ae460b65787c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312889
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Kallen Tu 2023-07-12 20:02:11 +00:00 committed by Commit Queue
parent 3daa47b54e
commit c7187d3150

File diff suppressed because it is too large Load diff