Skip to content

Commit

Permalink
[tests] Migrate language/function_type/test_generator.dart
Browse files Browse the repository at this point in the history
- 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 <kallentu@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
  • Loading branch information
rakudrama authored and Commit Queue committed Nov 1, 2023
1 parent e20ccee commit 248afd5
Show file tree
Hide file tree
Showing 101 changed files with 1,112 additions and 1,116 deletions.
20 changes: 10 additions & 10 deletions tests/language/function_type/function_type0_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class U0<T> {
Expect.isFalse(f1 is F1<bool>);
Expect.isTrue(confuse(f1) is F1<int>);
Expect.isFalse(confuse(f1) is F1<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x1 = (f1 as dynamic);
});
Expand Down Expand Up @@ -429,7 +429,7 @@ class U0<T> {
Expect.isFalse(f9 is F9<bool>);
Expect.isTrue(confuse(f9) is F9<int>);
Expect.isFalse(confuse(f9) is F9<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x9 = (f9 as dynamic);
});
Expand Down Expand Up @@ -503,7 +503,7 @@ class U0<T> {
Expect.isFalse(f11 is F11<bool>);
Expect.isTrue(confuse(f11) is F11<int>);
Expect.isFalse(confuse(f11) is F11<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x11 = (f11 as dynamic);
});
Expand Down Expand Up @@ -601,7 +601,7 @@ class U0<T> {
Expect.isFalse(f14 is F14<bool>);
Expect.isTrue(confuse(f14) is F14<int>);
Expect.isFalse(confuse(f14) is F14<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x14 = (f14 as dynamic);
});
Expand Down Expand Up @@ -651,7 +651,7 @@ class U0<T> {
Expect.isFalse(f15 is F15<bool>);
Expect.isTrue(confuse(f15) is F15<int>);
Expect.isFalse(confuse(f15) is F15<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x15 = (f15 as dynamic);
});
Expand Down Expand Up @@ -748,7 +748,7 @@ class U0<T> {
Expect.isFalse(f18 is F18<bool>);
Expect.isTrue(confuse(f18) is F18<int>);
Expect.isFalse(confuse(f18) is F18<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x18 = (f18 as dynamic);
});
Expand Down Expand Up @@ -821,7 +821,7 @@ class U0<T> {
Expect.isFalse(f20 is F20<bool>);
Expect.isTrue(confuse(f20) is F20<int>);
Expect.isFalse(confuse(f20) is F20<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x20 = (f20 as dynamic);
});
Expand Down Expand Up @@ -917,7 +917,7 @@ class U0<T> {
}

void main() {
new U0().runTests();
new U0<int>(tIsInt: true).runTests();
new U0<bool>(tIsBool: true).runTests();
U0().runTests();
U0<int>(tIsInt: true).runTests();
U0<bool>(tIsBool: true).runTests();
}
18 changes: 9 additions & 9 deletions tests/language/function_type/function_type10_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class U10<T> {
Expect.isFalse(f1 is F1<bool>);
Expect.isTrue(confuse(f1) is F1<int>);
Expect.isFalse(confuse(f1) is F1<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x1 = (f1 as dynamic);
});
Expand Down Expand Up @@ -518,7 +518,7 @@ class U10<T> {
Expect.isFalse(f11 is F11<bool>);
Expect.isTrue(confuse(f11) is F11<int>);
Expect.isFalse(confuse(f11) is F11<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x11 = (f11 as dynamic);
});
Expand Down Expand Up @@ -621,7 +621,7 @@ class U10<T> {
Expect.isFalse(f14 is F14<bool>);
Expect.isTrue(confuse(f14) is F14<int>);
Expect.isFalse(confuse(f14) is F14<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x14 = (f14 as dynamic);
});
Expand Down Expand Up @@ -671,7 +671,7 @@ class U10<T> {
Expect.isFalse(f15 is F15<bool>);
Expect.isTrue(confuse(f15) is F15<int>);
Expect.isFalse(confuse(f15) is F15<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x15 = (f15 as dynamic);
});
Expand Down Expand Up @@ -819,7 +819,7 @@ class U10<T> {
Expect.isFalse(f20 is F20<bool>);
Expect.isTrue(confuse(f20) is F20<int>);
Expect.isFalse(confuse(f20) is F20<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x20 = (f20 as dynamic);
});
Expand Down Expand Up @@ -894,7 +894,7 @@ class U10<T> {
Expect.isFalse(f22 is F22<bool>);
Expect.isTrue(confuse(f22) is F22<int>);
Expect.isFalse(confuse(f22) is F22<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x22 = (f22 as dynamic);
});
Expand Down Expand Up @@ -942,7 +942,7 @@ class U10<T> {
}

void main() {
new U10().runTests();
new U10<int>(tIsInt: true).runTests();
new U10<bool>(tIsBool: true).runTests();
U10().runTests();
U10<int>(tIsInt: true).runTests();
U10<bool>(tIsBool: true).runTests();
}
16 changes: 8 additions & 8 deletions tests/language/function_type/function_type11_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ class U11<T> {
Expect.isFalse(f11 is F11<bool>);
Expect.isTrue(confuse(f11) is F11<int>);
Expect.isFalse(confuse(f11) is F11<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x11 = (f11 as dynamic);
});
Expand Down Expand Up @@ -615,7 +615,7 @@ class U11<T> {
Expect.isFalse(f14 is F14<bool>);
Expect.isTrue(confuse(f14) is F14<int>);
Expect.isFalse(confuse(f14) is F14<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x14 = (f14 as dynamic);
});
Expand Down Expand Up @@ -666,7 +666,7 @@ class U11<T> {
Expect.isFalse(f15 is F15<bool>);
Expect.isTrue(confuse(f15) is F15<int>);
Expect.isFalse(confuse(f15) is F15<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x15 = (f15 as dynamic);
});
Expand Down Expand Up @@ -817,7 +817,7 @@ class U11<T> {
Expect.isFalse(f20 is F20<bool>);
Expect.isTrue(confuse(f20) is F20<int>);
Expect.isFalse(confuse(f20) is F20<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x20 = (f20 as dynamic);
});
Expand Down Expand Up @@ -893,7 +893,7 @@ class U11<T> {
Expect.isFalse(f22 is F22<bool>);
Expect.isTrue(confuse(f22) is F22<int>);
Expect.isFalse(confuse(f22) is F22<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x22 = (f22 as dynamic);
});
Expand Down Expand Up @@ -942,7 +942,7 @@ class U11<T> {
}

void main() {
new U11().runTests();
new U11<int>(tIsInt: true).runTests();
new U11<bool>(tIsBool: true).runTests();
U11().runTests();
U11<int>(tIsInt: true).runTests();
U11<bool>(tIsBool: true).runTests();
}
22 changes: 11 additions & 11 deletions tests/language/function_type/function_type12_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class U12<T> {
Expect.isFalse(f2 is F2<bool>);
Expect.isTrue(confuse(f2) is F2<int>);
Expect.isFalse(confuse(f2) is F2<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x2 = (f2 as dynamic);
});
Expand Down Expand Up @@ -304,7 +304,7 @@ class U12<T> {
Expect.isFalse(f4 is F4<bool>);
Expect.isTrue(confuse(f4) is F4<int>);
Expect.isFalse(confuse(f4) is F4<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x4 = (f4 as dynamic);
});
Expand Down Expand Up @@ -498,7 +498,7 @@ class U12<T> {
Expect.isFalse(f11 is F11<bool>);
Expect.isTrue(confuse(f11) is F11<int>);
Expect.isFalse(confuse(f11) is F11<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x11 = (f11 as dynamic);
});
Expand Down Expand Up @@ -571,7 +571,7 @@ class U12<T> {
Expect.isFalse(f13 is F13<bool>);
Expect.isTrue(confuse(f13) is F13<int>);
Expect.isFalse(confuse(f13) is F13<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x13 = (f13 as dynamic);
});
Expand Down Expand Up @@ -620,7 +620,7 @@ class U12<T> {
Expect.isFalse(f14 is F14<bool>);
Expect.isTrue(confuse(f14) is F14<int>);
Expect.isFalse(confuse(f14) is F14<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x14 = (f14 as dynamic);
});
Expand Down Expand Up @@ -669,7 +669,7 @@ class U12<T> {
Expect.isFalse(f15 is F15<bool>);
Expect.isTrue(confuse(f15) is F15<int>);
Expect.isFalse(confuse(f15) is F15<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x15 = (f15 as dynamic);
});
Expand Down Expand Up @@ -814,7 +814,7 @@ class U12<T> {
Expect.isFalse(f20 is F20<bool>);
Expect.isTrue(confuse(f20) is F20<int>);
Expect.isFalse(confuse(f20) is F20<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x20 = (f20 as dynamic);
});
Expand Down Expand Up @@ -863,7 +863,7 @@ class U12<T> {
Expect.isFalse(f21 is F21<bool>);
Expect.isTrue(confuse(f21) is F21<int>);
Expect.isFalse(confuse(f21) is F21<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x21 = (f21 as dynamic);
});
Expand Down Expand Up @@ -935,7 +935,7 @@ class U12<T> {
}

void main() {
new U12().runTests();
new U12<int>(tIsInt: true).runTests();
new U12<bool>(tIsBool: true).runTests();
U12().runTests();
U12<int>(tIsInt: true).runTests();
U12<bool>(tIsBool: true).runTests();
}
20 changes: 10 additions & 10 deletions tests/language/function_type/function_type13_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class U13<T> {
Expect.isFalse(f2 is F2<bool>);
Expect.isTrue(confuse(f2) is F2<int>);
Expect.isFalse(confuse(f2) is F2<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x2 = (f2 as dynamic);
});
Expand Down Expand Up @@ -478,7 +478,7 @@ class U13<T> {
Expect.isFalse(f11 is F11<bool>);
Expect.isTrue(confuse(f11) is F11<int>);
Expect.isFalse(confuse(f11) is F11<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x11 = (f11 as dynamic);
});
Expand Down Expand Up @@ -553,7 +553,7 @@ class U13<T> {
Expect.isFalse(f13 is F13<bool>);
Expect.isTrue(confuse(f13) is F13<int>);
Expect.isFalse(confuse(f13) is F13<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x13 = (f13 as dynamic);
});
Expand Down Expand Up @@ -602,7 +602,7 @@ class U13<T> {
Expect.isFalse(f14 is F14<bool>);
Expect.isTrue(confuse(f14) is F14<int>);
Expect.isFalse(confuse(f14) is F14<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x14 = (f14 as dynamic);
});
Expand Down Expand Up @@ -652,7 +652,7 @@ class U13<T> {
Expect.isFalse(f15 is F15<bool>);
Expect.isTrue(confuse(f15) is F15<int>);
Expect.isFalse(confuse(f15) is F15<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x15 = (f15 as dynamic);
});
Expand Down Expand Up @@ -797,7 +797,7 @@ class U13<T> {
Expect.isFalse(f20 is F20<bool>);
Expect.isTrue(confuse(f20) is F20<int>);
Expect.isFalse(confuse(f20) is F20<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x20 = (f20 as dynamic);
});
Expand Down Expand Up @@ -846,7 +846,7 @@ class U13<T> {
Expect.isFalse(f21 is F21<bool>);
Expect.isTrue(confuse(f21) is F21<int>);
Expect.isFalse(confuse(f21) is F21<bool>);
if (tIsBool) {
if (tIsBool && !dart2jsProductionMode) {
Expect.throws(() {
x21 = (f21 as dynamic);
});
Expand Down Expand Up @@ -918,7 +918,7 @@ class U13<T> {
}

void main() {
new U13().runTests();
new U13<int>(tIsInt: true).runTests();
new U13<bool>(tIsBool: true).runTests();
U13().runTests();
U13<int>(tIsInt: true).runTests();
U13<bool>(tIsBool: true).runTests();
}
Loading

0 comments on commit 248afd5

Please sign in to comment.