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

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

Issue 2957593002: Spelling fixes e to i. (Closed)
Patch Set: Created 3 years, 5 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 * The optional [check] function can provide additional validation 433 * The optional [check] function can provide additional validation
434 * that the correct exception is being thrown. For example, to check 434 * that the correct exception is being thrown. For example, to check
435 * the type of the exception you could write this: 435 * the type of the exception you could write this:
436 * 436 *
437 * Expect.throws(myThrowingFunction, (e) => e is MyException); 437 * Expect.throws(myThrowingFunction, (e) => e is MyException);
438 */ 438 */
439 static void throws(void f(), 439 static void throws(void f(),
440 [_CheckExceptionFn check = null, String reason = null]) { 440 [_CheckExceptionFn check = null, String reason = null]) {
441 String msg = reason == null ? "" : "($reason)"; 441 String msg = reason == null ? "" : "($reason)";
442 if (f is! _Nullary) { 442 if (f is! _Nullary) {
443 // Only throws from executing the funtion body should count as throwing. 443 // Only throws from executing the function body should count as throwing.
444 // The failure to even call `f` should throw outside the try/catch. 444 // The failure to even call `f` should throw outside the try/catch.
445 _fail("Expect.throws$msg: Function f not callable with zero arguments"); 445 _fail("Expect.throws$msg: Function f not callable with zero arguments");
446 } 446 }
447 try { 447 try {
448 f(); 448 f();
449 } catch (e, s) { 449 } catch (e, s) {
450 if (check != null) { 450 if (check != null) {
451 if (!check(e)) { 451 if (!check(e)) {
452 _fail("Expect.throws$msg: Unexpected '$e'\n$s"); 452 _fail("Expect.throws$msg: Unexpected '$e'\n$s");
453 } 453 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 const TrustTypeAnnotations(); 496 const TrustTypeAnnotations();
497 } 497 }
498 498
499 /// Annotation class for testing of dart2js. Use this as metadata on method 499 /// Annotation class for testing of dart2js. Use this as metadata on method
500 /// declarations to disable closed world assumptions on parameters, effectively 500 /// declarations to disable closed world assumptions on parameters, effectively
501 /// assuming that the runtime arguments could be any value. Note that the 501 /// assuming that the runtime arguments could be any value. Note that the
502 /// constraints due to [TrustTypeAnnotations] still apply. 502 /// constraints due to [TrustTypeAnnotations] still apply.
503 class AssumeDynamic { 503 class AssumeDynamic {
504 const AssumeDynamic(); 504 const AssumeDynamic();
505 } 505 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/string_helper.dart ('k') | pkg/front_end/lib/compiler_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698