Skip to content

Commit 199bc8f

Browse files
johnniwintherCommit Queue
authored andcommitted
[cfe] Fix some CFE tests
Change-Id: I569e385a98514c66a6761fcf7825ae884ad71fc0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413740 Commit-Queue: Johnni Winther <[email protected]> Reviewed-by: Jens Johansen <[email protected]>
1 parent ee32a22 commit 199bc8f

12 files changed

+42
-92
lines changed

pkg/front_end/lib/src/compute_platform_binaries_location.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ String? computePlatformDillName(Target target, void Function() onError) {
2121
// DDC is always compiled against the outline so we use it here by
2222
// default.
2323
return 'ddc_outline.dill';
24-
// Coverage-ignore(suite): Not run.
25-
//TODO(johnniwinther): Support using the full dill.
26-
//return 'ddc_platform.dill';
24+
//TODO(johnniwinther): Support using the full dill.
25+
//return 'ddc_platform.dill';
2726
case 'dart2js':
2827
return 'dart2js_platform.dill';
2928
case 'dart2js_server':

pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,13 @@ class ExtensionTypeMembersNode {
282282

283283
ClassMember? getStaticMember(Name name, bool isSetter) {
284284
ClassMember? result = isSetter
285-
? (extensionTypeSetableMap?[name] ?? nonExtensionTypeSetableMap?[name])
286-
: (extensionTypeGetableMap?[name] ?? nonExtensionTypeGetableMap?[name]);
285+
?
286+
// Coverage-ignore(suite): Not run.
287+
(extensionTypeSetableMap?[name] ?? nonExtensionTypeSetableMap?[name])
288+
: (extensionTypeGetableMap?[name] ??
289+
nonExtensionTypeGetableMap
290+
// Coverage-ignore(suite): Not run.
291+
?[name]);
287292
if (result == null) {
288293
return null;
289294
} else if (result.isStatic) {

pkg/front_end/lib/src/kernel/hierarchy/members_node.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,8 +1189,11 @@ class ClassMembersNode {
11891189
}
11901190

11911191
ClassMember? getStaticMember(Name name, bool isSetter) {
1192-
ClassMember? result =
1193-
isSetter ? classSetterMap[name] : classMemberMap[name];
1192+
ClassMember? result = isSetter
1193+
?
1194+
// Coverage-ignore(suite): Not run.
1195+
classSetterMap[name]
1196+
: classMemberMap[name];
11941197
if (result == null) {
11951198
return null;
11961199
} else if (result.isStatic) {

pkg/front_end/lib/src/kernel/kernel_target.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,7 @@ class KernelTarget {
787787

788788
String? _getLibraryNnbdModeError(Component component) {
789789
if (loader.hasInvalidNnbdModeLibrary) {
790+
// Coverage-ignore-block(suite): Not run.
790791
// At least 1 library should be invalid or there should be a mix of strong
791792
// and weak. For libraries we've just compiled it will be marked as
792793
// invalid, but for libraries loaded from dill they have their original

pkg/front_end/lib/src/source/source_loader.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ class SourceLoader extends Loader {
618618
libraryBuilder, messageInvalidNnbdDillLibrary);
619619
} else {
620620
if (libraryMode != NonNullableByDefaultCompiledMode.Strong) {
621+
// Coverage-ignore-block(suite): Not run.
621622
registerNnbdMismatchLibrary(
622623
libraryBuilder, messageStrongWithWeakDillLibrary);
623624
}
@@ -1098,6 +1099,7 @@ severity: $severity
10981099

10991100
Map<LibraryBuilder, Message>? _nnbdMismatchLibraries;
11001101

1102+
// Coverage-ignore(suite): Not run.
11011103
void registerNnbdMismatchLibrary(
11021104
LibraryBuilder libraryBuilder, Message message) {
11031105
_nnbdMismatchLibraries ??= {};
@@ -1136,6 +1138,7 @@ severity: $severity
11361138
currentUriForCrashReporting = null;
11371139
logSummary(outlineSummaryTemplate);
11381140
if (_nnbdMismatchLibraries != null) {
1141+
// Coverage-ignore-block(suite): Not run.
11391142
for (MapEntry<LibraryBuilder, Message> entry
11401143
in _nnbdMismatchLibraries!.entries) {
11411144
addProblem(entry.value, -1, noLength, entry.key.fileUri);

pkg/front_end/test/coverage_suite_expected.dart

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
150150
),
151151
// 100.0%.
152152
"package:front_end/src/base/incremental_compiler.dart": (
153-
hitCount: 850,
153+
hitCount: 846,
154154
missCount: 0,
155155
),
156156
// 100.0%.
@@ -205,7 +205,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
205205
),
206206
// 100.0%.
207207
"package:front_end/src/base/processed_options.dart": (
208-
hitCount: 260,
208+
hitCount: 251,
209209
missCount: 0,
210210
),
211211
// 100.0%.
@@ -405,7 +405,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
405405
),
406406
// 100.0%.
407407
"package:front_end/src/compute_platform_binaries_location.dart": (
408-
hitCount: 49,
408+
hitCount: 46,
409409
missCount: 0,
410410
),
411411
// 100.0%.
@@ -625,7 +625,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
625625
),
626626
// 100.0%.
627627
"package:front_end/src/kernel/constant_evaluator.dart": (
628-
hitCount: 3730,
628+
hitCount: 3697,
629629
missCount: 0,
630630
),
631631
// 100.0%.
@@ -680,7 +680,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
680680
),
681681
// 100.0%.
682682
"package:front_end/src/kernel/hierarchy/extension_type_members.dart": (
683-
hitCount: 388,
683+
hitCount: 393,
684684
missCount: 0,
685685
),
686686
// 100.0%.
@@ -695,7 +695,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
695695
),
696696
// 100.0%.
697697
"package:front_end/src/kernel/hierarchy/members_builder.dart": (
698-
hitCount: 133,
698+
hitCount: 136,
699699
missCount: 0,
700700
),
701701
// 100.0%.
@@ -740,7 +740,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
740740
),
741741
// 100.0%.
742742
"package:front_end/src/kernel/kernel_target.dart": (
743-
hitCount: 1044,
743+
hitCount: 1017,
744744
missCount: 0,
745745
),
746746
// 100.0%.
@@ -750,7 +750,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
750750
),
751751
// 100.0%.
752752
"package:front_end/src/kernel/late_lowering.dart": (
753-
hitCount: 368,
753+
hitCount: 362,
754754
missCount: 0,
755755
),
756756
// 100.0%.
@@ -805,7 +805,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
805805
),
806806
// 100.0%.
807807
"package:front_end/src/kernel_generator_impl.dart": (
808-
hitCount: 47,
808+
hitCount: 46,
809809
missCount: 0,
810810
),
811811
// 100.0%.
@@ -860,17 +860,17 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
860860
),
861861
// 100.0%.
862862
"package:front_end/src/source/source_class_builder.dart": (
863-
hitCount: 1399,
863+
hitCount: 1398,
864864
missCount: 0,
865865
),
866866
// 100.0%.
867867
"package:front_end/src/source/source_compilation_unit.dart": (
868-
hitCount: 674,
868+
hitCount: 669,
869869
missCount: 0,
870870
),
871871
// 100.0%.
872872
"package:front_end/src/source/source_constructor_builder.dart": (
873-
hitCount: 699,
873+
hitCount: 704,
874874
missCount: 0,
875875
),
876876
// 100.0%.
@@ -880,7 +880,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
880880
),
881881
// 100.0%.
882882
"package:front_end/src/source/source_extension_builder.dart": (
883-
hitCount: 159,
883+
hitCount: 158,
884884
missCount: 0,
885885
),
886886
// 100.0%.
@@ -891,7 +891,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
891891
),
892892
// 100.0%.
893893
"package:front_end/src/source/source_factory_builder.dart": (
894-
hitCount: 1011,
894+
hitCount: 1016,
895895
missCount: 0,
896896
),
897897
// 100.0%.
@@ -906,7 +906,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
906906
),
907907
// 100.0%.
908908
"package:front_end/src/source/source_loader.dart": (
909-
hitCount: 1819,
909+
hitCount: 1792,
910910
missCount: 0,
911911
),
912912
// 100.0%.
@@ -916,12 +916,12 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
916916
),
917917
// 100.0%.
918918
"package:front_end/src/source/source_method_builder.dart": (
919-
hitCount: 229,
919+
hitCount: 235,
920920
missCount: 0,
921921
),
922922
// 100.0%.
923923
"package:front_end/src/source/source_property_builder.dart": (
924-
hitCount: 678,
924+
hitCount: 688,
925925
missCount: 0,
926926
),
927927
// 100.0%.
@@ -991,7 +991,7 @@ const Map<String, ({int hitCount, int missCount})> _expect = {
991991
),
992992
// 100.0%.
993993
"package:front_end/src/type_inference/matching_expressions.dart": (
994-
hitCount: 521,
994+
hitCount: 519,
995995
missCount: 0,
996996
),
997997
// 100.0%.

pkg/front_end/testcases/expression/issue52905.expression.yaml.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ method /* from org-dartlang-debug:synthetic_debug_expression */ debugExpr() →
2424
break #L1;
2525
}
2626
}
27-
throw{for-error-handling} new dart._internal::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type.");
2827
}
2928
} =>#t1;
3029
constants {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Errors: {
22
}
33
method /* from org-dartlang-debug:synthetic_debug_expression */ debugExpr() → dynamic
4-
return let final Never #t1 = dart.io::exit(2) in throw{for-error-handling} new dart._internal::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
4+
return dart.io::exit(2);

pkg/front_end/testcases/incremental/change_between_no_nnbd_and_nnbd.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

pkg/front_end/testcases/incremental/change_between_no_nnbd_and_nnbd.yaml.world.1.expect

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)