Skip to content

Commit 8968e0e

Browse files
nshahanCommit Queue
authored andcommitted
[ddc] Remove unsound null safety option from tests
Change-Id: I1da8a572fc3556b03141a312375fa91bb3a8f358 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386084 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Nicholas Shahan <[email protected]> Reviewed-by: Nate Biggs <[email protected]>
1 parent b693194 commit 8968e0e

29 files changed

+97
-216
lines changed

pkg/dev_compiler/test/expression_compiler/expression_compiler_e2e_amd_agnostic_shard_1_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ import 'expression_compiler_e2e_suite.dart';
1313
void main(List<String> args) async {
1414
var driver = await ExpressionEvaluationTestDriver.init();
1515

16-
group('(Sound null safety) (Agnostic code shard 1)', () {
16+
group('(Agnostic code shard 1)', () {
1717
tearDownAll(() async {
1818
await driver.finish();
1919
});
2020

2121
group('(AMD module system)', () {
2222
var setup = SetupCompilerOptions(
23-
soundNullSafety: true,
2423
moduleFormat: ModuleFormat.amd,
2524
args: args,
2625
);

pkg/dev_compiler/test/expression_compiler/expression_compiler_e2e_amd_agnostic_shard_2_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ import 'expression_compiler_e2e_suite.dart';
1313
void main(List<String> args) async {
1414
var driver = await ExpressionEvaluationTestDriver.init();
1515

16-
group('(Sound null safety) (Agnostic code shard 2)', () {
16+
group('(Agnostic code shard 2)', () {
1717
tearDownAll(() async {
1818
await driver.finish();
1919
});
2020

2121
group('(AMD module system)', () {
2222
var setup = SetupCompilerOptions(
23-
soundNullSafety: true,
2423
moduleFormat: ModuleFormat.amd,
2524
args: args,
2625
);

pkg/dev_compiler/test/expression_compiler/expression_compiler_e2e_amd_null_safe_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ void main(List<String> args) async {
1515
final debug = false;
1616
var driver = await ExpressionEvaluationTestDriver.init();
1717

18-
group('(Sound null safety)', () {
18+
group('(Null safe code)', () {
1919
tearDownAll(() async {
2020
await driver.finish();
2121
});
2222

2323
group('(AMD module system)', () {
2424
var setup = SetupCompilerOptions(
25-
soundNullSafety: true,
2625
moduleFormat: ModuleFormat.amd,
2726
args: args,
2827
);

pkg/dev_compiler/test/expression_compiler/expression_compiler_e2e_dart_2_17_test.dart

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,20 @@ void main(List<String> args) async {
1616
tearDownAll(() async {
1717
await driver.finish();
1818
});
19+
group('(AMD module system)', () {
20+
var setup = SetupCompilerOptions(
21+
moduleFormat: ModuleFormat.amd,
22+
args: args,
23+
);
24+
runSharedTests(setup, driver);
25+
});
1926

20-
group('(Sound null safety)', () {
21-
group('(AMD module system)', () {
22-
var setup = SetupCompilerOptions(
23-
soundNullSafety: true,
24-
moduleFormat: ModuleFormat.amd,
25-
args: args,
26-
);
27-
runSharedTests(setup, driver);
28-
});
29-
30-
group('(DDC module system)', () {
31-
var setup = SetupCompilerOptions(
32-
soundNullSafety: true,
33-
moduleFormat: ModuleFormat.ddc,
34-
args: args,
35-
);
36-
runSharedTests(setup, driver);
37-
});
27+
group('(DDC module system)', () {
28+
var setup = SetupCompilerOptions(
29+
moduleFormat: ModuleFormat.ddc,
30+
args: args,
31+
);
32+
runSharedTests(setup, driver);
3833
});
3934
});
4035
}

pkg/dev_compiler/test/expression_compiler/expression_compiler_e2e_dart_3_0_test.dart

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,20 @@ void main(List<String> args) async {
1717
await driver.finish();
1818
});
1919

20-
group('(Sound null safety)', () {
21-
group('(AMD module system)', () {
22-
var setup = SetupCompilerOptions(
23-
soundNullSafety: true,
24-
moduleFormat: ModuleFormat.amd,
25-
args: args,
26-
);
27-
runSharedTests(setup, driver);
28-
});
29-
30-
group('(DDC module system)', () {
31-
var setup = SetupCompilerOptions(
32-
soundNullSafety: true,
33-
moduleFormat: ModuleFormat.ddc,
34-
args: args,
35-
);
36-
runSharedTests(setup, driver);
37-
});
20+
group('(AMD module system)', () {
21+
var setup = SetupCompilerOptions(
22+
moduleFormat: ModuleFormat.amd,
23+
args: args,
24+
);
25+
runSharedTests(setup, driver);
26+
});
27+
28+
group('(DDC module system)', () {
29+
var setup = SetupCompilerOptions(
30+
moduleFormat: ModuleFormat.ddc,
31+
args: args,
32+
);
33+
runSharedTests(setup, driver);
3834
});
3935
});
4036
}

pkg/dev_compiler/test/expression_compiler/expression_compiler_e2e_ddc_agnostic_shard_1_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ import 'expression_compiler_e2e_suite.dart';
1313
void main(List<String> args) async {
1414
var driver = await ExpressionEvaluationTestDriver.init();
1515

16-
group('(Sound null safety) (Agnostic code shard 1)', () {
16+
group('(Agnostic code shard 1)', () {
1717
tearDownAll(() async {
1818
await driver.finish();
1919
});
2020

2121
group('(DDC module system)', () {
2222
var setup = SetupCompilerOptions(
23-
soundNullSafety: true,
2423
moduleFormat: ModuleFormat.ddc,
2524
args: args,
2625
);

pkg/dev_compiler/test/expression_compiler/expression_compiler_e2e_ddc_agnostic_shard_2_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ import 'expression_compiler_e2e_suite.dart';
1313
void main(List<String> args) async {
1414
var driver = await ExpressionEvaluationTestDriver.init();
1515

16-
group('(Sound null safety) (Agnostic code shard 2)', () {
16+
group('(Agnostic code shard 2)', () {
1717
tearDownAll(() async {
1818
await driver.finish();
1919
});
2020

2121
group('(DDC module system)', () {
2222
var setup = SetupCompilerOptions(
23-
soundNullSafety: true,
2423
moduleFormat: ModuleFormat.ddc,
2524
args: args,
2625
);

pkg/dev_compiler/test/expression_compiler/expression_compiler_e2e_ddc_null_safe_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ import 'expression_compiler_e2e_suite.dart';
1313
void main(List<String> args) async {
1414
var driver = await ExpressionEvaluationTestDriver.init();
1515

16-
group('(Sound null safety)', () {
16+
group('(Null safe code)', () {
1717
tearDownAll(() async {
1818
await driver.finish();
1919
});
2020

2121
group('(DDC module system)', () {
2222
var setup = SetupCompilerOptions(
23-
soundNullSafety: true,
2423
moduleFormat: ModuleFormat.ddc,
2524
args: args,
2625
);

pkg/dev_compiler/test/expression_compiler/expression_compiler_e2e_shared.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,14 @@ void runNullSafeSharedTests(
462462
await driver.checkInFrame(
463463
breakpointId: 'soundNullSafetyBP',
464464
expression: 'soundNullSafety',
465-
expectedResult: setup.soundNullSafety.toString());
465+
expectedResult: 'true');
466466
});
467467

468468
test('in expression compilation', () async {
469469
await driver.checkInFrame(
470470
breakpointId: 'soundNullSafetyBP',
471471
expression: '!(<Null>[] is List<int>)',
472-
expectedResult: setup.soundNullSafety.toString());
472+
expectedResult: 'true');
473473
});
474474
});
475475

@@ -895,14 +895,14 @@ void runAgnosticSharedTestsShard1(
895895
await driver.checkInFrame(
896896
breakpointId: 'soundNullSafetyBP',
897897
expression: 'soundNullSafety',
898-
expectedResult: setup.soundNullSafety.toString());
898+
expectedResult: 'true');
899899
});
900900

901901
test('in expression compilation', () async {
902902
await driver.checkInFrame(
903903
breakpointId: 'soundNullSafetyBP',
904904
expression: '!(<Null>[] is List<int>)',
905-
expectedResult: setup.soundNullSafety.toString());
905+
expectedResult: 'true');
906906
});
907907
});
908908

pkg/dev_compiler/test/expression_compiler/expression_compiler_e2e_suite.dart

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ class ExpressionEvaluationTestDriver {
182182
'gen',
183183
'utils',
184184
'ddc',
185-
'${setup.canaryFeatures ? 'canary' : 'stable'}'
186-
'${setup.soundNullSafety ? '' : '_unsound'}',
185+
setup.canaryFeatures ? 'canary' : 'stable',
187186
'sdk',
188187
'ddc',
189188
'dart_sdk.js'))
@@ -202,18 +201,7 @@ class ExpressionEvaluationTestDriver {
202201
<script>
203202
'use strict';
204203
let dartApplication = true;
205-
var sound = ${setup.soundNullSafety};
206-
207-
let sdkOptions = {};
208-
209-
if (sound) {
210-
sdkOptions['nativeNonNullAsserts'] = true;
211-
} else {
212-
sdkOptions['weakNullSafetyWarnings'] = false;
213-
sdkOptions['weakNullSafetyErrors'] = false;
214-
sdkOptions['nonNullAsserts'] = true;
215-
}
216-
204+
let sdkOptions = { nativeNonNullAsserts: true };
217205
// Unlike the typical app bootstraper, we delay calling main until all
218206
// breakpoints are setup.
219207
let scheduleMain = () => {
@@ -232,17 +220,8 @@ class ExpressionEvaluationTestDriver {
232220
<script>
233221
'use strict';
234222
let dartApplication = true;
235-
var sound = ${setup.soundNullSafety};
236223
var sdk = dart_library.import('dart_sdk');
237-
238-
if (sound) {
239-
sdk.dart.nativeNonNullAsserts(true);
240-
} else {
241-
sdk.dart.weakNullSafetyWarnings(false);
242-
sdk.dart.weakNullSafetyErrors(false);
243-
sdk.dart.nonNullAsserts(true);
244-
}
245-
224+
sdk.dart.nativeNonNullAsserts(true);
246225
// Unlike the typical app bootstraper, we delay calling main until all
247226
// breakpoints are setup.
248227
let scheduleMain = () => {
@@ -257,8 +236,7 @@ class ExpressionEvaluationTestDriver {
257236
'gen',
258237
'utils',
259238
'ddc',
260-
'${setup.canaryFeatures ? 'canary' : 'stable'}'
261-
'${setup.soundNullSafety ? '' : '_unsound'}',
239+
setup.canaryFeatures ? 'canary' : 'stable',
262240
'sdk',
263241
'amd',
264242
'dart_sdk'))
@@ -292,19 +270,10 @@ class ExpressionEvaluationTestDriver {
292270
let scheduleMain = () => {
293271
scheduleMainCalled = true;
294272
};
295-
var sound = ${setup.soundNullSafety};
296273
require(['dart_sdk', '$moduleName'],
297274
function(sdk, app) {
298275
'use strict';
299-
300-
if (sound) {
301-
sdk.dart.nativeNonNullAsserts(true);
302-
} else {
303-
sdk.dart.weakNullSafetyWarnings(false);
304-
sdk.dart.weakNullSafetyErrors(false);
305-
sdk.dart.nonNullAsserts(true);
306-
}
307-
276+
sdk.dart.nativeNonNullAsserts(true);
308277
scheduleMain = () => {
309278
app.$mainLibraryName.main([]);
310279
};

0 commit comments

Comments
 (0)