Skip to content

Commit 5855358

Browse files
authored
Add a sentence to clarify "Platform" (#2550)
A "platform" in the test runner's use encompasses more detail than might be expected. Add a sentence in the description of platform selectors to note that it can cover details about how the code is compiled. Closes #2548
1 parent 8083c8f commit 5855358

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pkgs/test/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Require Dart 3.7
55
* Add `--coverage-path` and `--branch-coverage` options to `dart test`.
66
* Serve dart2wasm source map files.
7+
* Doc edit: clarify in README that a platform selector includes the compiler.
78

89
## 1.26.3
910

pkgs/test/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,15 @@ adding a [`test_on` field] to your package config file.
322322

323323
Platform selectors use the [boolean selector syntax] defined in the
324324
[`boolean_selector`] package, which is a subset of Dart's expression syntax that
325-
only supports boolean operations. The following identifiers are defined:
325+
only supports boolean operations. The platform selectors identify overlapping
326+
subsets of the ways that Dart code can be compiled and run.
326327

327328
[boolean selector syntax]: https://github.com/dart-lang/boolean_selector/blob/master/README.md
328329

329330
[`boolean_selector`]: https://pub.dev/packages/boolean_selector
330331

332+
The following identifiers are defined:
333+
331334
* `vm`: Whether the test is running on the command-line Dart VM.
332335

333336
* `chrome`: Whether the test is running on Google Chrome.
@@ -379,8 +382,9 @@ only supports boolean operations. The following identifiers are defined:
379382

380383
* `source`: Whether the test has been run with no compiler (from source).
381384

382-
For example, if you wanted to run a test on every browser but Chrome, you would
383-
write `@TestOn('browser && !chrome')`.
385+
For example, if you wanted to run a test on every browser but Chrome compiled
386+
with dart2js (in opposition to dart2wasm), you would write
387+
`@TestOn('browser && !chrome && dart2js')`.
384388

385389
### Running Tests on Node.js
386390

0 commit comments

Comments
 (0)