Files
sdk/pkg/analyzer_testing/lib/mock_packages
Sam Rawlins 1188d014a9 analyzer_testing: improve error message when trying to use built-in mocks
Work towards https://github.com/dart-lang/sdk/issues/61597

The analyzer_testing package's mock packages are "data" or "resource"
files which are notoriously hard to find on disk. No dart tooling I
know of can give me "the root directory of a package which is
referenced in a Dart program via "package:". Konstantin notes that
a program may be compiled ahead of time, and so the running VM itself
does not know where source files originally came from.

When users of the analyzer_testing package try to use
`addFlutterPackageDep` in a test, which attempts to locate the Dart
SDK's `pkg/` root directory, they get a StateError. This CL adds more
information and context to that error.

Change-Id: I3ae55cd580c8fa16ca86d66e6f7b655b8f9bcc42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452532
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-09-30 21:21:39 -07:00
..