In an effort to support running tests in pure-Dart projects (because you may want to work on a pure-Dart project for use in a Flutter project), we try to be smart about which invocation to use: flutter test or pub run test.
But we are not smart enough: we assume a Flutter project only if the file has a import package:flutter(_test)?/... statement, and otherwise assume a Dart project.
This falls down for pure-Dart files in Flutter packages.
We need some cheap way of determining whether the project is a Flutter one or not.
In an effort to support running tests in pure-Dart projects (because you may want to work on a pure-Dart project for use in a Flutter project), we try to be smart about which invocation to use:
flutter testorpub run test.But we are not smart enough: we assume a Flutter project only if the file has a
import package:flutter(_test)?/...statement, and otherwise assume a Dart project.This falls down for pure-Dart files in Flutter packages.
We need some cheap way of determining whether the project is a Flutter one or not.