OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 library test.mixin; |
| 6 |
| 7 import 'dart:mirrors'; |
| 8 |
| 9 import 'package:expect/expect.dart'; |
| 10 |
| 11 class Super {} |
| 12 class Mixin {} |
| 13 class Mixin2 {} |
| 14 |
| 15 class Class extends Super with Mixin {} |
| 16 class MultipleMixins extends Class with Mixin2 {} |
| 17 |
| 18 main() { |
| 19 Expect.equals(reflectClass(Class), |
| 20 reflectClass(Class).mixin); |
| 21 Expect.equals(reflectClass(Mixin), |
| 22 reflectClass(Class).superclass.mixin); |
| 23 Expect.equals(reflectClass(Super), |
| 24 reflectClass(Class).superclass.superclass.mixin); |
| 25 |
| 26 Expect.equals(reflectClass(MultipleMixins), |
| 27 reflectClass(MultipleMixins).mixin); |
| 28 Expect.equals(reflectClass(Mixin2), |
| 29 reflectClass(MultipleMixins).superclass.mixin); |
| 30 Expect.equals(reflectClass(Class), |
| 31 reflectClass(MultipleMixins).superclass.superclass.mixin); |
| 32 Expect.equals(reflectClass(Mixin), |
| 33 reflectClass(MultipleMixins).superclass.superclass.superclass |
| 34 .mixin); |
| 35 Expect.equals(reflectClass(Super), |
| 36 reflectClass(MultipleMixins).superclass.superclass.superclass |
| 37 .superclass.mixin); |
| 38 } |
OLD | NEW |