| OLD | NEW |
| 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 #import('dart:uri'); | 5 #import('dart:uri'); |
| 6 #import('parser_helper.dart'); | 6 #import('parser_helper.dart'); |
| 7 #import("../../../lib/compiler/compiler.dart"); | 7 #import("../../../lib/compiler/compiler.dart"); |
| 8 #import("../../../lib/compiler/implementation/tree/tree.dart"); | 8 #import("../../../lib/compiler/implementation/tree/tree.dart"); |
| 9 | 9 |
| 10 testUnparse(String statement) { | 10 testUnparse(String statement) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 continuation = (s) { Expect.equals(src, s); }; | 42 continuation = (s) { Expect.equals(src, s); }; |
| 43 } | 43 } |
| 44 testDart2DartWithLibrary(src, '', continuation); | 44 testDart2DartWithLibrary(src, '', continuation); |
| 45 } | 45 } |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Library name is assumed to be 'mylib' in 'mylib.dart' file. | 48 * Library name is assumed to be 'mylib' in 'mylib.dart' file. |
| 49 */ | 49 */ |
| 50 testDart2DartWithLibrary( | 50 testDart2DartWithLibrary( |
| 51 String srcMain, String srcLibrary, [void continuation(String s)]) { | 51 String srcMain, String srcLibrary, [void continuation(String s)]) { |
| 52 fileUri(path) => new Uri(scheme: 'file', path: path); | 52 fileUri(path) => new Uri.fromComponents(scheme: 'file', path: path); |
| 53 | 53 |
| 54 final scriptUri = fileUri('script.dart'); | 54 final scriptUri = fileUri('script.dart'); |
| 55 final libUri = fileUri('mylib.dart'); | 55 final libUri = fileUri('mylib.dart'); |
| 56 | 56 |
| 57 provider(uri) { | 57 provider(uri) { |
| 58 if (uri == scriptUri) return new Future.immediate(srcMain); | 58 if (uri == scriptUri) return new Future.immediate(srcMain); |
| 59 if (uri.toString() == libUri.toString()) { | 59 if (uri.toString() == libUri.toString()) { |
| 60 return new Future.immediate(srcLibrary); | 60 return new Future.immediate(srcLibrary); |
| 61 } | 61 } |
| 62 if (uri.path.endsWith('/core.dart')) return new Future.immediate(coreLib); | 62 if (uri.path.endsWith('/core.dart')) return new Future.immediate(coreLib); |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 testGetSet(); | 425 testGetSet(); |
| 426 testFactoryConstructor(); | 426 testFactoryConstructor(); |
| 427 testTopLevelField(); | 427 testTopLevelField(); |
| 428 testAbstractClass(); | 428 testAbstractClass(); |
| 429 testConflictLibraryClassRename(); | 429 testConflictLibraryClassRename(); |
| 430 testNoConflictSendsRename(); | 430 testNoConflictSendsRename(); |
| 431 testConflictSendsRename(); | 431 testConflictSendsRename(); |
| 432 testDefaultClassWithArgs(); | 432 testDefaultClassWithArgs(); |
| 433 testClassExtendsWithArgs(); | 433 testClassExtendsWithArgs(); |
| 434 } | 434 } |
| OLD | NEW |