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

Unified Diff: tests/standalone/byte_array_test.dart

Issue 11017072: Fix byte_array_test to work in checked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/byte_array_test.dart
diff --git a/tests/standalone/byte_array_test.dart b/tests/standalone/byte_array_test.dart
index 11bccddb661fa517078e41cee997fd76e2502776..1565488ace4ed4c9adc3961b22f1067292be9c6e 100644
--- a/tests/standalone/byte_array_test.dart
+++ b/tests/standalone/byte_array_test.dart
@@ -107,9 +107,15 @@ void testSubArray() {
testThrowsIndex(() => array.subByteArray(11));
testThrowsIndex(() => array.subByteArray(11, null));
testThrowsIndex(() => array.subByteArray(6, 5));
- Expect.throws(() => array.subByteArray(0, "5"), (e) => e is ArgumentError);
- Expect.throws(() => array.subByteArray("0", 5), (e) => e is ArgumentError);
- Expect.throws(() => array.subByteArray("0"), (e) => e is ArgumentError);
+
+ bool checkedMode = false;
+ assert(checkedMode = true);
+ if (!checkedMode) {
+ // In checked mode these will necessarily throw a TypeError.
+ Expect.throws(() => array.subByteArray(0, "5"), (e) => e is ArgumentError);
+ Expect.throws(() => array.subByteArray("0", 5), (e) => e is ArgumentError);
+ Expect.throws(() => array.subByteArray("0"), (e) => e is ArgumentError);
+ }
Expect.throws(() => array.subByteArray(null), (e) => e is ArgumentError);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698