From 9cc511138bc88365cd9f053ce7759ef9061df8ed Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Thu, 16 Oct 2025 23:51:44 +0000 Subject: [PATCH 1/3] Add a sentence to clarify "Platform" 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. Replaces #2548 --- pkgs/test/README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/test/README.md b/pkgs/test/README.md index ccca4504a..7f4ed8263 100644 --- a/pkgs/test/README.md +++ b/pkgs/test/README.md @@ -322,12 +322,16 @@ adding a [`test_on` field] to your package config file. Platform selectors use the [boolean selector syntax] defined in the [`boolean_selector`] package, which is a subset of Dart's expression syntax that -only supports boolean operations. The following identifiers are defined: +only supports boolean operations. The platform selectors identify overlapping +subsets of the ways that Dart code can be compiled and run. [boolean selector syntax]: https://github.com/dart-lang/boolean_selector/blob/master/README.md [`boolean_selector`]: https://pub.dev/packages/boolean_selector +The following identifiers are defined: + + * `vm`: Whether the test is running on the command-line Dart VM. * `chrome`: Whether the test is running on Google Chrome. @@ -379,8 +383,9 @@ only supports boolean operations. The following identifiers are defined: * `source`: Whether the test has been run with no compiler (from source). -For example, if you wanted to run a test on every browser but Chrome, you would -write `@TestOn('browser && !chrome')`. +For example, if you wanted to run a test on every browser but Chrome compiled +with dart2js (in opposition to dart2wasm), you would write +`@TestOn('browser && !chrome && dart2js')`. ### Running Tests on Node.js From 27343500474819d75b56227d9388e888810e23dc Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Thu, 16 Oct 2025 23:55:29 +0000 Subject: [PATCH 2/3] drop extra newline --- pkgs/test/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/test/README.md b/pkgs/test/README.md index 7f4ed8263..9da43d2a7 100644 --- a/pkgs/test/README.md +++ b/pkgs/test/README.md @@ -331,7 +331,6 @@ subsets of the ways that Dart code can be compiled and run. The following identifiers are defined: - * `vm`: Whether the test is running on the command-line Dart VM. * `chrome`: Whether the test is running on Google Chrome. From 1560aa1699116ce15b65c0329c9cccfee5058ed7 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Thu, 16 Oct 2025 23:58:09 +0000 Subject: [PATCH 3/3] Add changelog Not super necessary, but not harmful and quiets the bot --- pkgs/test/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md index 2a9474861..8d4d33255 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -4,6 +4,7 @@ * Require Dart 3.7 * Add `--coverage-path` and `--branch-coverage` options to `dart test`. * Serve dart2wasm source map files. +* Doc edit: clarify in README that a platform selector includes the compiler. ## 1.26.3