Files
sdk/pkg/analyzer_testing/lib/experiments/experiments.dart
T
Chloe Stefantsova d6ad61c2ca [analyzer] Collect enabled experiments in experimentsForTests
This CL removes the unnecessary overrides of the `experiments` getter
from the tests and collects the corresponding experiment flags added to
the returned value of the getter in the individual tests to the
'experimentsForTests' list that is used by all tests. Specifically, the
experiments `variance` is enabled for all tests.

The flag `inference_update_1` is removed from the experiments list,
since it's enabled by default. In the tests that explicitly require a
distinction between the flag being enabled and disabled, the getter
`_isEnabled` is overridden and returns a value corresponding to the
test.

The flag `inference_update_4` still appears in one of the overrides of
the `experiments` getter, since enabling it in all tests appears
breaking.

This is a follow-up to
https://dart-review.googlesource.com/c/sdk/+/430720/comment/4c3f016e_4933f925/

Change-Id: I4d35e3c6259e2f7e6751d180b5790c13f68de1ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-07-01 22:48:49 -07:00

24 lines
958 B
Dart

// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/analysis/features.dart';
/// A list of the experiments that are to be enabled for tests.
///
/// The list will be empty if there are no experiments that should be enabled.
///
/// Experiments should be added to this list when work on a new experiment
/// begins. Experiments should be removed from this list when they are marked
/// as being enabled by default.
///
/// The flags in the list are kept in alphabetic order for ease of determining
/// whether a given flag is already included.
List<String> experimentsForTests = [
Feature.augmentations.enableString,
Feature.dot_shorthands.enableString,
Feature.enhanced_parts.enableString,
Feature.macros.enableString,
Feature.variance.enableString,
];