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

Side by Side Diff: pkg/expect/lib/expect.dart

Issue 2985243002: Migrate block 44. (Closed)
Patch Set: Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * This library contains an Expect class with static methods that can be used 6 * This library contains an Expect class with static methods that can be used
7 * for simple unit-tests. 7 * for simple unit-tests.
8 */ 8 */
9 library expect; 9 library expect;
10 10
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 } 453 }
454 return; 454 return;
455 } 455 }
456 _fail('Expect.throws$msg fails: Did not throw'); 456 _fail('Expect.throws$msg fails: Did not throw');
457 } 457 }
458 458
459 static void throwsArgumentError(void f()) { 459 static void throwsArgumentError(void f()) {
460 Expect.throws(f, (error) => error is ArgumentError, "ArgumentError"); 460 Expect.throws(f, (error) => error is ArgumentError, "ArgumentError");
461 } 461 }
462 462
463 static void throwsAssertionError(void f()) {
464 Expect.throws(f, (error) => error is AssertionError, "AssertionError");
465 }
466
463 static void throwsCastError(void f()) { 467 static void throwsCastError(void f()) {
464 Expect.throws(f, (error) => error is CastError, "CastError"); 468 Expect.throws(f, (error) => error is CastError, "CastError");
465 } 469 }
466 470
467 static void throwsNoSuchMethodError(void f()) { 471 static void throwsNoSuchMethodError(void f()) {
468 Expect.throws( 472 Expect.throws(
469 f, (error) => error is NoSuchMethodError, "NoSuchMethodError"); 473 f, (error) => error is NoSuchMethodError, "NoSuchMethodError");
470 } 474 }
471 475
472 static void throwsRangeError(void f()) { 476 static void throwsRangeError(void f()) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 } on AssertionError catch (e) { 555 } on AssertionError catch (e) {
552 return true; 556 return true;
553 } 557 }
554 return false; 558 return false;
555 })(); 559 })();
556 560
557 /// Is true iff checked mode is enabled. 561 /// Is true iff checked mode is enabled.
558 // TODO(rnystrom): Remove this once all tests are no longer using it. 562 // TODO(rnystrom): Remove this once all tests are no longer using it.
559 final bool checkedModeEnabled = 563 final bool checkedModeEnabled =
560 typeAssertionsEnabled && assertStatementsEnabled; 564 typeAssertionsEnabled && assertStatementsEnabled;
OLDNEW
« no previous file with comments | « no previous file | tests/language/bool_check_test.dart » ('j') | tests/language_2/bool_check_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698