Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Commit 6ecda17

Browse files
Dart Teamalan-knight
Dart Team
authored andcommitted
Use platform_env instead of dart_env in package:intl tests.
The VM is about to switch to use the CFE's constant evaluator. This change will break const.fromEnvironment on modular builds (which affects blaze and build_runner). Because the only purpose of these definitions was to pass arguments to tests, we can replace them with a runtime Platform.environment variable. Context: b/129881700 and dart-lang/sdk#36513 PiperOrigin-RevId: 242916034
1 parent 53bc5f4 commit 6ecda17

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/timezone_test_core.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ final dart = Platform.executable;
1616
/// running in that time zone, verify that the DateTime offset is one of the
1717
/// expected values.
1818
testTimezone(String timezoneName, {int expectedUtcOffset}) {
19-
// The VM can be invoked with a "-DPACKAGE_DIR=<directory>" argument to
20-
// indicate the root of the Intl package. If it is not provided, we assume
21-
// that the root of the Intl package is the current directory.
22-
var packageDir = const String.fromEnvironment('PACKAGE_DIR');
19+
// Define the environment variable "PACKAGE_DIR=<directory>" to indicate the
20+
// root of the Intl package. If it is not provided, we assume that the root of
21+
// the Intl package is the current directory.
22+
var packageDir = Platform.environment['PACKAGE_DIR'];
2323
var packageRelative = 'test/timezone_local_even_test_helper.dart';
2424
var fileToSpawn =
2525
packageDir == null ? packageRelative : '$packageDir/$packageRelative';

0 commit comments

Comments
 (0)