Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(780)

Unified Diff: tests/language/void_type_test.dart

Issue 2718513002: Void is not required to be `null` anymore. (Closed)
Patch Set: Update Kernel code. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/void_check_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/void_type_test.dart
diff --git a/tests/language/void_type_test.dart b/tests/language/void_type_test.dart
index faf8b3f2ff31c71268f3d34d1f49da84a9648d0b..2ce3233c25b98b6f0263b9f3b366cd680fcfedfd 100644
--- a/tests/language/void_type_test.dart
+++ b/tests/language/void_type_test.dart
@@ -41,7 +41,7 @@ void f_f() {
return f();
}
-void test(int n, void func(), bool must_get_error) {
+void test(int n, void func()) {
// Test as closure call.
{
bool got_type_error = false;
@@ -50,12 +50,7 @@ void test(int n, void func(), bool must_get_error) {
} on TypeError catch (error) {
got_type_error = true;
}
- // Never a type error in production mode.
- if (isCheckedMode()) {
- Expect.isTrue(got_type_error == must_get_error);
- } else {
- Expect.isFalse(got_type_error);
- }
+ Expect.isFalse(got_type_error);
}
// Test as direct call.
{
@@ -85,20 +80,15 @@ void test(int n, void func(), bool must_get_error) {
} on TypeError catch (error) {
got_type_error = true;
}
- // Never a type error in production mode.
- if (isCheckedMode()) {
- Expect.isTrue(got_type_error == must_get_error);
- } else {
- Expect.isFalse(got_type_error);
- }
+ Expect.isFalse(got_type_error);
}
}
main() {
- test(0, f, false);
- test(1, f_null, false);
- test(2, f_1, true);
- test(3, f_dyn_null, false);
- test(4, f_dyn_1, true);
- test(5, f_f, false);
+ test(0, f);
+ test(1, f_null);
+ test(2, f_1);
+ test(3, f_dyn_null);
+ test(4, f_dyn_1);
+ test(5, f_f);
}
« no previous file with comments | « tests/language/void_check_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698