@@ -30,42 +30,43 @@ void main() {
3030 exit (1 );
3131 }
3232
33- // This doesn't have the `max` because NNBD is supposed to work after this
34- // version, and if the `max` is placed here we'll silently pass 2.10 stable
35- // if we haven't figured out how to switch on NNBD outside of `dev` builds
36- // as specified in #2148.
37- final _nnbdExperimentAllowed =
33+ // This doesn't have the `max` because Null safety is supposed to work after
34+ // this version, and if the `max` is placed here we'll silently pass 2.10
35+ // stable if we haven't figured out how to switch on Null safety outside of
36+ // dev builds as specified in #2148.
37+ final _nullSafetyExperimentAllowed =
3838 VersionRange (min: Version .parse ('2.9.0-9.0.dev' ), includeMin: true );
3939
40- // Experimental features not yet enabled by default. Move tests out of this block
41- // when the feature is enabled by default.
40+ // Experimental features not yet enabled by default. Move tests out of this
41+ // block when the feature is enabled by default.
4242 group ('Experiments' , () {
4343 Library lateFinalWithoutInitializer,
44- nnbdClassMemberDeclarations ,
45- optOutOfNnbd ,
44+ nullSafetyClassMemberDeclarations ,
45+ optOutOfNullSafety ,
4646 nullableElements;
4747 Class b;
4848
4949 setUpAll (() async {
5050 lateFinalWithoutInitializer = (await utils.testPackageGraphExperiments)
5151 .libraries
5252 .firstWhere ((lib) => lib.name == 'late_final_without_initializer' );
53- nnbdClassMemberDeclarations = (await utils.testPackageGraphExperiments)
53+ nullSafetyClassMemberDeclarations = (await utils
54+ .testPackageGraphExperiments)
5455 .libraries
5556 .firstWhere ((lib) => lib.name == 'nnbd_class_member_declarations' );
56- optOutOfNnbd = (await utils.testPackageGraphExperiments)
57+ optOutOfNullSafety = (await utils.testPackageGraphExperiments)
5758 .libraries
5859 .firstWhere ((lib) => lib.name == 'opt_out_of_nnbd' );
5960 nullableElements = (await utils.testPackageGraphExperiments)
6061 .libraries
6162 .firstWhere ((lib) => lib.name == 'nullable_elements' );
62- b = nnbdClassMemberDeclarations .allClasses
63+ b = nullSafetyClassMemberDeclarations .allClasses
6364 .firstWhere ((c) => c.name == 'B' );
6465 });
6566
66- test ('isNNBD is set correctly for libraries' , () {
67- expect (lateFinalWithoutInitializer.isNNBD , isTrue);
68- expect (optOutOfNnbd.isNNBD , isFalse);
67+ test ('isNullSafety is set correctly for libraries' , () {
68+ expect (lateFinalWithoutInitializer.isNullSafety , isTrue);
69+ expect (optOutOfNullSafety.isNullSafety , isFalse);
6970 });
7071
7172 test ('method parameters with required' , () {
@@ -118,8 +119,8 @@ void main() {
118119 var cField = c.instanceFields.firstWhere ((f) => f.name == 'cField' );
119120 var dField = c.instanceFields.firstWhere ((f) => f.name == 'dField' );
120121
121- // If nnbd isn't enabled, fields named 'late' come back from the analyzer
122- // instead of setting up 'isLate'.
122+ // If Null safety isn't enabled, fields named 'late' come back from the
123+ // analyzer instead of setting up 'isLate'.
123124 expect (c.instanceFields.any ((f) => f.name == 'late' ), isFalse);
124125
125126 expect (a.modelType.returnType.name, equals ('dynamic' ));
@@ -147,10 +148,10 @@ void main() {
147148 expect (initializeMe.features, contains ('late' ));
148149 });
149150
150- test ('Opt out of NNBD ' , () {
151- var notOptedIn = optOutOfNnbd .publicProperties
151+ test ('Opt out of Null safety ' , () {
152+ var notOptedIn = optOutOfNullSafety .publicProperties
152153 .firstWhere ((v) => v.name == 'notOptedIn' );
153- expect (notOptedIn.isNNBD , isFalse);
154+ expect (notOptedIn.isNullSafety , isFalse);
154155 expect (notOptedIn.modelType.nullabilitySuffix, isEmpty);
155156 });
156157
@@ -161,7 +162,7 @@ void main() {
161162 .firstWhere ((f) => f.name == 'aComplexType' );
162163 var aComplexSetterOnlyType = complexNullableMembers.allFields
163164 .firstWhere ((f) => f.name == 'aComplexSetterOnlyType' );
164- expect (complexNullableMembers.isNNBD , isTrue);
165+ expect (complexNullableMembers.isNullSafety , isTrue);
165166 expect (
166167 complexNullableMembers.nameWithGenerics,
167168 equals (
@@ -186,7 +187,7 @@ void main() {
186187 .firstWhere ((f) => f.name == 'methodWithNullables' );
187188 var operatorStar = nullableMembers.publicInstanceOperators
188189 .firstWhere ((f) => f.name == 'operator *' );
189- expect (nullableMembers.isNNBD , isTrue);
190+ expect (nullableMembers.isNullSafety , isTrue);
190191 expect (
191192 nullableField.linkedReturnType,
192193 equals (
@@ -206,7 +207,7 @@ void main() {
206207 '<span class="parameter" id="*-param-nullableOther"><span class="type-annotation"><a href="%%__HTMLBASE_dartdoc_internal__%%nullable_elements/NullableMembers-class.html">NullableMembers</a>?</span> <span class="parameter-name">nullableOther</span></span><wbr>' ));
207208 });
208209 },
209- skip: (! _nnbdExperimentAllowed .allows (_platformVersion) &&
210+ skip: (! _nullSafetyExperimentAllowed .allows (_platformVersion) &&
210211 ! _platformVersionString.contains ('edge' )));
211212
212213 group ('HTML Injection when allowed' , () {
0 commit comments