Skip to content

Commit 248afd5

Browse files
rakudramaCommit Queue
authored and
Commit Queue
committed
[tests] Migrate language/function_type/test_generator.dart
- Migrate language/function_type/test_generator.dart to null safety. - Add logic to avoid some tests under `dart2jsProductionMode`. - Re-run generator. - `dart format` generated files. Change-Id: I2d7fd787d0710ae2e844b699b2a25b01744cf78f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333048 Reviewed-by: Kallen Tu <[email protected]> Commit-Queue: Stephen Adams <[email protected]>
1 parent e20ccee commit 248afd5

File tree

101 files changed

+1112
-1116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1112
-1116
lines changed

tests/language/function_type/function_type0_test.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class U0<T> {
211211
Expect.isFalse(f1 is F1<bool>);
212212
Expect.isTrue(confuse(f1) is F1<int>);
213213
Expect.isFalse(confuse(f1) is F1<bool>);
214-
if (tIsBool) {
214+
if (tIsBool && !dart2jsProductionMode) {
215215
Expect.throws(() {
216216
x1 = (f1 as dynamic);
217217
});
@@ -429,7 +429,7 @@ class U0<T> {
429429
Expect.isFalse(f9 is F9<bool>);
430430
Expect.isTrue(confuse(f9) is F9<int>);
431431
Expect.isFalse(confuse(f9) is F9<bool>);
432-
if (tIsBool) {
432+
if (tIsBool && !dart2jsProductionMode) {
433433
Expect.throws(() {
434434
x9 = (f9 as dynamic);
435435
});
@@ -503,7 +503,7 @@ class U0<T> {
503503
Expect.isFalse(f11 is F11<bool>);
504504
Expect.isTrue(confuse(f11) is F11<int>);
505505
Expect.isFalse(confuse(f11) is F11<bool>);
506-
if (tIsBool) {
506+
if (tIsBool && !dart2jsProductionMode) {
507507
Expect.throws(() {
508508
x11 = (f11 as dynamic);
509509
});
@@ -601,7 +601,7 @@ class U0<T> {
601601
Expect.isFalse(f14 is F14<bool>);
602602
Expect.isTrue(confuse(f14) is F14<int>);
603603
Expect.isFalse(confuse(f14) is F14<bool>);
604-
if (tIsBool) {
604+
if (tIsBool && !dart2jsProductionMode) {
605605
Expect.throws(() {
606606
x14 = (f14 as dynamic);
607607
});
@@ -651,7 +651,7 @@ class U0<T> {
651651
Expect.isFalse(f15 is F15<bool>);
652652
Expect.isTrue(confuse(f15) is F15<int>);
653653
Expect.isFalse(confuse(f15) is F15<bool>);
654-
if (tIsBool) {
654+
if (tIsBool && !dart2jsProductionMode) {
655655
Expect.throws(() {
656656
x15 = (f15 as dynamic);
657657
});
@@ -748,7 +748,7 @@ class U0<T> {
748748
Expect.isFalse(f18 is F18<bool>);
749749
Expect.isTrue(confuse(f18) is F18<int>);
750750
Expect.isFalse(confuse(f18) is F18<bool>);
751-
if (tIsBool) {
751+
if (tIsBool && !dart2jsProductionMode) {
752752
Expect.throws(() {
753753
x18 = (f18 as dynamic);
754754
});
@@ -821,7 +821,7 @@ class U0<T> {
821821
Expect.isFalse(f20 is F20<bool>);
822822
Expect.isTrue(confuse(f20) is F20<int>);
823823
Expect.isFalse(confuse(f20) is F20<bool>);
824-
if (tIsBool) {
824+
if (tIsBool && !dart2jsProductionMode) {
825825
Expect.throws(() {
826826
x20 = (f20 as dynamic);
827827
});
@@ -917,7 +917,7 @@ class U0<T> {
917917
}
918918

919919
void main() {
920-
new U0().runTests();
921-
new U0<int>(tIsInt: true).runTests();
922-
new U0<bool>(tIsBool: true).runTests();
920+
U0().runTests();
921+
U0<int>(tIsInt: true).runTests();
922+
U0<bool>(tIsBool: true).runTests();
923923
}

tests/language/function_type/function_type10_test.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class U10<T> {
244244
Expect.isFalse(f1 is F1<bool>);
245245
Expect.isTrue(confuse(f1) is F1<int>);
246246
Expect.isFalse(confuse(f1) is F1<bool>);
247-
if (tIsBool) {
247+
if (tIsBool && !dart2jsProductionMode) {
248248
Expect.throws(() {
249249
x1 = (f1 as dynamic);
250250
});
@@ -518,7 +518,7 @@ class U10<T> {
518518
Expect.isFalse(f11 is F11<bool>);
519519
Expect.isTrue(confuse(f11) is F11<int>);
520520
Expect.isFalse(confuse(f11) is F11<bool>);
521-
if (tIsBool) {
521+
if (tIsBool && !dart2jsProductionMode) {
522522
Expect.throws(() {
523523
x11 = (f11 as dynamic);
524524
});
@@ -621,7 +621,7 @@ class U10<T> {
621621
Expect.isFalse(f14 is F14<bool>);
622622
Expect.isTrue(confuse(f14) is F14<int>);
623623
Expect.isFalse(confuse(f14) is F14<bool>);
624-
if (tIsBool) {
624+
if (tIsBool && !dart2jsProductionMode) {
625625
Expect.throws(() {
626626
x14 = (f14 as dynamic);
627627
});
@@ -671,7 +671,7 @@ class U10<T> {
671671
Expect.isFalse(f15 is F15<bool>);
672672
Expect.isTrue(confuse(f15) is F15<int>);
673673
Expect.isFalse(confuse(f15) is F15<bool>);
674-
if (tIsBool) {
674+
if (tIsBool && !dart2jsProductionMode) {
675675
Expect.throws(() {
676676
x15 = (f15 as dynamic);
677677
});
@@ -819,7 +819,7 @@ class U10<T> {
819819
Expect.isFalse(f20 is F20<bool>);
820820
Expect.isTrue(confuse(f20) is F20<int>);
821821
Expect.isFalse(confuse(f20) is F20<bool>);
822-
if (tIsBool) {
822+
if (tIsBool && !dart2jsProductionMode) {
823823
Expect.throws(() {
824824
x20 = (f20 as dynamic);
825825
});
@@ -894,7 +894,7 @@ class U10<T> {
894894
Expect.isFalse(f22 is F22<bool>);
895895
Expect.isTrue(confuse(f22) is F22<int>);
896896
Expect.isFalse(confuse(f22) is F22<bool>);
897-
if (tIsBool) {
897+
if (tIsBool && !dart2jsProductionMode) {
898898
Expect.throws(() {
899899
x22 = (f22 as dynamic);
900900
});
@@ -942,7 +942,7 @@ class U10<T> {
942942
}
943943

944944
void main() {
945-
new U10().runTests();
946-
new U10<int>(tIsInt: true).runTests();
947-
new U10<bool>(tIsBool: true).runTests();
945+
U10().runTests();
946+
U10<int>(tIsInt: true).runTests();
947+
U10<bool>(tIsBool: true).runTests();
948948
}

tests/language/function_type/function_type11_test.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ class U11<T> {
512512
Expect.isFalse(f11 is F11<bool>);
513513
Expect.isTrue(confuse(f11) is F11<int>);
514514
Expect.isFalse(confuse(f11) is F11<bool>);
515-
if (tIsBool) {
515+
if (tIsBool && !dart2jsProductionMode) {
516516
Expect.throws(() {
517517
x11 = (f11 as dynamic);
518518
});
@@ -615,7 +615,7 @@ class U11<T> {
615615
Expect.isFalse(f14 is F14<bool>);
616616
Expect.isTrue(confuse(f14) is F14<int>);
617617
Expect.isFalse(confuse(f14) is F14<bool>);
618-
if (tIsBool) {
618+
if (tIsBool && !dart2jsProductionMode) {
619619
Expect.throws(() {
620620
x14 = (f14 as dynamic);
621621
});
@@ -666,7 +666,7 @@ class U11<T> {
666666
Expect.isFalse(f15 is F15<bool>);
667667
Expect.isTrue(confuse(f15) is F15<int>);
668668
Expect.isFalse(confuse(f15) is F15<bool>);
669-
if (tIsBool) {
669+
if (tIsBool && !dart2jsProductionMode) {
670670
Expect.throws(() {
671671
x15 = (f15 as dynamic);
672672
});
@@ -817,7 +817,7 @@ class U11<T> {
817817
Expect.isFalse(f20 is F20<bool>);
818818
Expect.isTrue(confuse(f20) is F20<int>);
819819
Expect.isFalse(confuse(f20) is F20<bool>);
820-
if (tIsBool) {
820+
if (tIsBool && !dart2jsProductionMode) {
821821
Expect.throws(() {
822822
x20 = (f20 as dynamic);
823823
});
@@ -893,7 +893,7 @@ class U11<T> {
893893
Expect.isFalse(f22 is F22<bool>);
894894
Expect.isTrue(confuse(f22) is F22<int>);
895895
Expect.isFalse(confuse(f22) is F22<bool>);
896-
if (tIsBool) {
896+
if (tIsBool && !dart2jsProductionMode) {
897897
Expect.throws(() {
898898
x22 = (f22 as dynamic);
899899
});
@@ -942,7 +942,7 @@ class U11<T> {
942942
}
943943

944944
void main() {
945-
new U11().runTests();
946-
new U11<int>(tIsInt: true).runTests();
947-
new U11<bool>(tIsBool: true).runTests();
945+
U11().runTests();
946+
U11<int>(tIsInt: true).runTests();
947+
U11<bool>(tIsBool: true).runTests();
948948
}

tests/language/function_type/function_type12_test.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class U12<T> {
231231
Expect.isFalse(f2 is F2<bool>);
232232
Expect.isTrue(confuse(f2) is F2<int>);
233233
Expect.isFalse(confuse(f2) is F2<bool>);
234-
if (tIsBool) {
234+
if (tIsBool && !dart2jsProductionMode) {
235235
Expect.throws(() {
236236
x2 = (f2 as dynamic);
237237
});
@@ -304,7 +304,7 @@ class U12<T> {
304304
Expect.isFalse(f4 is F4<bool>);
305305
Expect.isTrue(confuse(f4) is F4<int>);
306306
Expect.isFalse(confuse(f4) is F4<bool>);
307-
if (tIsBool) {
307+
if (tIsBool && !dart2jsProductionMode) {
308308
Expect.throws(() {
309309
x4 = (f4 as dynamic);
310310
});
@@ -498,7 +498,7 @@ class U12<T> {
498498
Expect.isFalse(f11 is F11<bool>);
499499
Expect.isTrue(confuse(f11) is F11<int>);
500500
Expect.isFalse(confuse(f11) is F11<bool>);
501-
if (tIsBool) {
501+
if (tIsBool && !dart2jsProductionMode) {
502502
Expect.throws(() {
503503
x11 = (f11 as dynamic);
504504
});
@@ -571,7 +571,7 @@ class U12<T> {
571571
Expect.isFalse(f13 is F13<bool>);
572572
Expect.isTrue(confuse(f13) is F13<int>);
573573
Expect.isFalse(confuse(f13) is F13<bool>);
574-
if (tIsBool) {
574+
if (tIsBool && !dart2jsProductionMode) {
575575
Expect.throws(() {
576576
x13 = (f13 as dynamic);
577577
});
@@ -620,7 +620,7 @@ class U12<T> {
620620
Expect.isFalse(f14 is F14<bool>);
621621
Expect.isTrue(confuse(f14) is F14<int>);
622622
Expect.isFalse(confuse(f14) is F14<bool>);
623-
if (tIsBool) {
623+
if (tIsBool && !dart2jsProductionMode) {
624624
Expect.throws(() {
625625
x14 = (f14 as dynamic);
626626
});
@@ -669,7 +669,7 @@ class U12<T> {
669669
Expect.isFalse(f15 is F15<bool>);
670670
Expect.isTrue(confuse(f15) is F15<int>);
671671
Expect.isFalse(confuse(f15) is F15<bool>);
672-
if (tIsBool) {
672+
if (tIsBool && !dart2jsProductionMode) {
673673
Expect.throws(() {
674674
x15 = (f15 as dynamic);
675675
});
@@ -814,7 +814,7 @@ class U12<T> {
814814
Expect.isFalse(f20 is F20<bool>);
815815
Expect.isTrue(confuse(f20) is F20<int>);
816816
Expect.isFalse(confuse(f20) is F20<bool>);
817-
if (tIsBool) {
817+
if (tIsBool && !dart2jsProductionMode) {
818818
Expect.throws(() {
819819
x20 = (f20 as dynamic);
820820
});
@@ -863,7 +863,7 @@ class U12<T> {
863863
Expect.isFalse(f21 is F21<bool>);
864864
Expect.isTrue(confuse(f21) is F21<int>);
865865
Expect.isFalse(confuse(f21) is F21<bool>);
866-
if (tIsBool) {
866+
if (tIsBool && !dart2jsProductionMode) {
867867
Expect.throws(() {
868868
x21 = (f21 as dynamic);
869869
});
@@ -935,7 +935,7 @@ class U12<T> {
935935
}
936936

937937
void main() {
938-
new U12().runTests();
939-
new U12<int>(tIsInt: true).runTests();
940-
new U12<bool>(tIsBool: true).runTests();
938+
U12().runTests();
939+
U12<int>(tIsInt: true).runTests();
940+
U12<bool>(tIsBool: true).runTests();
941941
}

tests/language/function_type/function_type13_test.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class U13<T> {
234234
Expect.isFalse(f2 is F2<bool>);
235235
Expect.isTrue(confuse(f2) is F2<int>);
236236
Expect.isFalse(confuse(f2) is F2<bool>);
237-
if (tIsBool) {
237+
if (tIsBool && !dart2jsProductionMode) {
238238
Expect.throws(() {
239239
x2 = (f2 as dynamic);
240240
});
@@ -478,7 +478,7 @@ class U13<T> {
478478
Expect.isFalse(f11 is F11<bool>);
479479
Expect.isTrue(confuse(f11) is F11<int>);
480480
Expect.isFalse(confuse(f11) is F11<bool>);
481-
if (tIsBool) {
481+
if (tIsBool && !dart2jsProductionMode) {
482482
Expect.throws(() {
483483
x11 = (f11 as dynamic);
484484
});
@@ -553,7 +553,7 @@ class U13<T> {
553553
Expect.isFalse(f13 is F13<bool>);
554554
Expect.isTrue(confuse(f13) is F13<int>);
555555
Expect.isFalse(confuse(f13) is F13<bool>);
556-
if (tIsBool) {
556+
if (tIsBool && !dart2jsProductionMode) {
557557
Expect.throws(() {
558558
x13 = (f13 as dynamic);
559559
});
@@ -602,7 +602,7 @@ class U13<T> {
602602
Expect.isFalse(f14 is F14<bool>);
603603
Expect.isTrue(confuse(f14) is F14<int>);
604604
Expect.isFalse(confuse(f14) is F14<bool>);
605-
if (tIsBool) {
605+
if (tIsBool && !dart2jsProductionMode) {
606606
Expect.throws(() {
607607
x14 = (f14 as dynamic);
608608
});
@@ -652,7 +652,7 @@ class U13<T> {
652652
Expect.isFalse(f15 is F15<bool>);
653653
Expect.isTrue(confuse(f15) is F15<int>);
654654
Expect.isFalse(confuse(f15) is F15<bool>);
655-
if (tIsBool) {
655+
if (tIsBool && !dart2jsProductionMode) {
656656
Expect.throws(() {
657657
x15 = (f15 as dynamic);
658658
});
@@ -797,7 +797,7 @@ class U13<T> {
797797
Expect.isFalse(f20 is F20<bool>);
798798
Expect.isTrue(confuse(f20) is F20<int>);
799799
Expect.isFalse(confuse(f20) is F20<bool>);
800-
if (tIsBool) {
800+
if (tIsBool && !dart2jsProductionMode) {
801801
Expect.throws(() {
802802
x20 = (f20 as dynamic);
803803
});
@@ -846,7 +846,7 @@ class U13<T> {
846846
Expect.isFalse(f21 is F21<bool>);
847847
Expect.isTrue(confuse(f21) is F21<int>);
848848
Expect.isFalse(confuse(f21) is F21<bool>);
849-
if (tIsBool) {
849+
if (tIsBool && !dart2jsProductionMode) {
850850
Expect.throws(() {
851851
x21 = (f21 as dynamic);
852852
});
@@ -918,7 +918,7 @@ class U13<T> {
918918
}
919919

920920
void main() {
921-
new U13().runTests();
922-
new U13<int>(tIsInt: true).runTests();
923-
new U13<bool>(tIsBool: true).runTests();
921+
U13().runTests();
922+
U13<int>(tIsInt: true).runTests();
923+
U13<bool>(tIsBool: true).runTests();
924924
}

0 commit comments

Comments
 (0)