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

Side by Side Diff: tests/compiler/dart2js_extra/deferred/deferred_function_test.dart

Issue 13467032: Fix typo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Test that loading of a library (with top-level functions only) can 5 // Test that loading of a library (with top-level functions only) can
6 // be deferred. 6 // be deferred.
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 @lazy import 'deferred_function_library.dart'; 9 @lazy import 'deferred_function_library.dart';
10 10
11 const lazy = const DeferredLibrary('deferred_function_library'); 11 const lazy = const DeferredLibrary('deferred_function_library');
12 12
13 isNoSuchMethodError(e) => e is NoSuchMethodError; 13 isNoSuchMethodError(e) => e is NoSuchMethodError;
14 14
15 class Expect { 15 class Expect {
16 static void isTrue(x) => Expect.equals(true, x); 16 static void isTrue(x) => Expect.equals(true, x);
17 17
18 static void isFalse(x) => Expect.equals(true, x); 18 static void isFalse(x) => Expect.equals(false, x);
19 19
20 static void equals(expected, actual) { 20 static void equals(expected, actual) {
21 if (expected != actual) { 21 if (expected != actual) {
22 throw "Not equal. Expected: $expected. Got: $actual"; 22 throw "Not equal. Expected: $expected. Got: $actual";
23 } 23 }
24 } 24 }
25 static void throws(fun, [test]) { 25 static void throws(fun, [test]) {
26 try { 26 try {
27 fun(); 27 fun();
28 } catch (e) { 28 } catch (e) {
(...skipping 19 matching lines...) Expand all
48 lazy.load().then((bool didLoad) { 48 lazy.load().then((bool didLoad) {
49 Expect.isFalse(didLoad); 49 Expect.isFalse(didLoad);
50 Expect.equals(2, ++counter); 50 Expect.equals(2, ++counter);
51 print('lazy was loaded'); 51 print('lazy was loaded');
52 Expect.equals(42, foo('b')); 52 Expect.equals(42, foo('b'));
53 print('unittest-suite-success'); 53 print('unittest-suite-success');
54 }); 54 });
55 Expect.equals(0, counter); 55 Expect.equals(0, counter);
56 Expect.throws(() { foo('a'); }, isNoSuchMethodError); 56 Expect.throws(() { foo('a'); }, isNoSuchMethodError);
57 } 57 }
OLDNEW
« 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