sdk
sdk copied to clipboard
use requirements and variations across all SDK tests
We are in the process of consolidating how we talk about variations of implementations in tests. This is a meta issue to track our work:
- [x] introduce a list of possible requirements test can demand. These are requirements based on current variations observed in Dart implementations like dart2js -O4 and AOT optimized runtimes. This will be eventually documented in our wiki, but currently includes things like: readable-type-strings, js-numbers, native-numbers, checked-parameters, checked-implicit-downcasts, etc).
- [ ] Add support for specifying these requirements at a coarse-grain level (using the
// Requirements=
comments) - [x] Add support for specifying fine-grain requirements (add a
pkg:expect/variations.dart
library). - [ ] Migrate all existing tests to use the new requirement APIs.
- [ ] Change, as needed,
Expect.throws
to take a conditional parameter to allow swapping expectations based on variations in behavior. This may require switching to named parameters to make tests more legible. - [ ] Document these changes and intended usage on the wiki.
Linking Siggi's CL https://github.com/dart-lang/sdk/commit/5bf858c3603fff0d3fe44a5af06ec03f56f67a27 here for adding support for fine-grain requirements (variations) for my own reference.