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 "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"; | 5 import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"; |
6 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; | 6 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; |
7 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; | 7 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; |
8 import "../../../sdk/lib/_internal/compiler/implementation/util/util.dart"; | 8 import "../../../sdk/lib/_internal/compiler/implementation/util/util.dart"; |
9 import "mock_compiler.dart"; | 9 import "mock_compiler.dart"; |
10 import "parser_helper.dart"; | 10 import "parser_helper.dart"; |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 "Unexpected warnings: ${compiler.warnings}"); | 409 "Unexpected warnings: ${compiler.warnings}"); |
410 print('testExternalWithoutImplementationMember:${compiler.errors}'); | 410 print('testExternalWithoutImplementationMember:${compiler.errors}'); |
411 Expect.equals(1, compiler.errors.length); | 411 Expect.equals(1, compiler.errors.length); |
412 Expect.isTrue( | 412 Expect.isTrue( |
413 compiler.errors[0].message.kind == | 413 compiler.errors[0].message.kind == |
414 MessageKind.EXTERNAL_WITHOUT_IMPLEMENTATION); | 414 MessageKind.EXTERNAL_WITHOUT_IMPLEMENTATION); |
415 Expect.equals('External method without an implementation.', | 415 Expect.equals('External method without an implementation.', |
416 compiler.errors[0].message.toString()); | 416 compiler.errors[0].message.toString()); |
417 } | 417 } |
418 | 418 |
| 419 testIsSubclass() { |
| 420 var compiler = applyPatch( |
| 421 """ |
| 422 class A {} |
| 423 """, |
| 424 """ |
| 425 patch class A {} |
| 426 """); |
| 427 ClassElement cls = ensure(compiler, "A", compiler.coreLibrary.find, |
| 428 expectIsPatched: true); |
| 429 ClassElement patch = cls.patch; |
| 430 Expect.isTrue(cls != patch); |
| 431 Expect.isTrue(cls.isSubclassOf(patch)); |
| 432 Expect.isTrue(patch.isSubclassOf(cls)); |
| 433 } |
| 434 |
419 main() { | 435 main() { |
420 testPatchFunction(); | 436 testPatchFunction(); |
421 testPatchMember(); | 437 testPatchMember(); |
422 testPatchGetter(); | 438 testPatchGetter(); |
423 testRegularMember(); | 439 testRegularMember(); |
424 testGhostMember(); | 440 testGhostMember(); |
425 testInjectFunction(); | 441 testInjectFunction(); |
426 testPatchSignatureCheck(); | 442 testPatchSignatureCheck(); |
427 | 443 |
428 testExternalWithoutImplementationTopLevel(); | 444 testExternalWithoutImplementationTopLevel(); |
429 testExternalWithoutImplementationMember(); | 445 testExternalWithoutImplementationMember(); |
| 446 |
| 447 testIsSubclass(); |
430 } | 448 } |
OLD | NEW |