dart-sdk/pkg/nnbd_migration/test
Paul Berry 1c86b2f5f6 Migration: tolerate relative imports into lib.
Prior to this fix, if the user's package had a relative import from
outside `lib` to inside `lib` (e.g. from `test` to `lib`), the
migration tool would regard the imported file as being reached via a
`file:` URI.  This caused it to get confused and complain that the
user had a dependency on unmigrated code (this happened because the
check for dependency on unmigrated code excluded the user's files via
their canonical URIs, and files inside `lib` use `package:` for their
canonical URIs).

To fix the problem, we modify the check for dependency on unmigrated
code so that it excludes the user's files via their path rather than
their URI.

Note that relative imports into the `lib` directory are discouraged by the style guide*, but it still seems worth fixing this bug since they do crop up in the wild.

*https://dart.dev/guides/language/effective-dart/usage#dont-allow-an-import-path-to-reach-into-or-out-of-lib

Fixes #45780.

Bug: https://github.com/dart-lang/sdk/issues/45780
Change-Id: Iff41ca0059d78bbb812dd6f421be6458e7049895
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196344
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-21 22:04:30 +00:00
..
front_end Add getResolvedUnit2(), deprecate getResolvedUnit(). 2021-04-16 21:33:54 +00:00
preview Update the server protocol to support passing back the line and column numbers for the end of a range 2021-03-18 19:22:23 +00:00
utilities [dartdev] add a --format option to dart analyze 2020-12-01 01:32:34 +00:00
abstract_context.dart Deprecated getFile() and getSourceKind(). Added getFile2() instead. 2021-04-19 23:57:19 +00:00
abstract_single_unit.dart Add getResolvedUnit2(), deprecate getResolvedUnit(). 2021-04-16 21:33:54 +00:00
already_migrated_code_decorator_test.dart Revert "Return List<XyzElementImpl> from ElementImpl getters." 2021-03-08 19:09:44 +00:00
api_test.dart Add getResolvedLibrary2(), deprecate getResolvedLibrary(). 2021-04-17 16:51:07 +00:00
api_test_base.dart Abstract resolution calls to .isNullAware. 2020-01-24 19:58:43 +00:00
decorated_class_hierarchy_test.dart Use DartType.getDisplayString() instead of toString(). 2020-02-05 07:33:19 +00:00
decorated_type_test.dart Migration: never produce a type of the form FutureOr<T?>?. 2020-07-23 13:24:48 +00:00
edge_builder_flow_analysis_test.dart Migrator: Use pedantic 1.9.0 2020-09-17 20:52:43 +00:00
edge_builder_test.dart Migration: properly assign types to collection literals. 2021-04-15 17:15:47 +00:00
edit_plan_test.dart Migration: fix futures using .then rather than as 2021-03-31 17:48:19 +00:00
edit_planner_pass_through_merging_test.dart Migration: add the ability to create EditPlans that remove source code. 2020-01-14 20:41:23 +00:00
fix_aggregator_test.dart Migration: fix futures using .then rather than as 2021-03-31 17:48:19 +00:00
fix_builder_test.dart Migration: do not attempt to modify named expressions. 2021-04-06 05:02:16 +00:00
fix_reason_target_test.dart Migration: track multiple fix reasons for expressions with complex types. 2020-04-14 23:33:46 +00:00
instrumentation_test.dart Add getResolvedUnit2(), deprecate getResolvedUnit(). 2021-04-16 21:33:54 +00:00
migration_cli_test.dart Migration: tolerate relative imports into lib. 2021-04-21 22:04:30 +00:00
migration_visitor_test_base.dart Revert "Return List<XyzElementImpl> from ElementImpl getters." 2021-03-08 19:09:44 +00:00
node_builder_test.dart dart migrate: Separate HintAction and HintActionKind into separate file 2021-01-20 21:54:53 +00:00
nullability_node_test.dart Migration: do not propagate exact nullability in violation of a /*!*/ hint. 2020-03-31 22:04:46 +00:00
test_all.dart Add a verify_tests_test.dart to pkg/nnbd_migration. 2020-11-11 18:09:18 +00:00
variables_test.dart Migration: make an inverse function for Variables.uniqueIdentifierForSpan. 2020-01-21 22:50:29 +00:00
verify_tests_test.dart Rename pkg/analysis_tool to pkg/analyzer_utilities. 2020-11-13 17:46:30 +00:00