| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this | 1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in | 2 // source code is governed by a BSD-style license that can be found in |
| 3 // the LICENSE file. | 3 // the LICENSE file. |
| 4 | 4 |
| 5 // File being transformed by the reflectable transformer. | 5 // File being transformed by the reflectable transformer. |
| 6 // Accesses method parameters and their properties, such as | 6 // Accesses method parameters and their properties, such as |
| 7 // existence, being optional, type annotations. | 7 // existence, being optional, type annotations. |
| 8 | 8 |
| 9 library test_reflectable.test.parameter_test; | 9 library test_reflectable.test.parameter_test; |
| 10 | 10 |
| 11 import 'package:reflectable/reflectable.dart'; | 11 import 'package:reflectable/reflectable.dart'; |
| 12 import 'package:unittest/unittest.dart'; | 12 import 'package:unittest/unittest.dart'; |
| 13 | 13 |
| 14 // TODO(eernst) implement: Avoid testing the same things twice in this test and |
| 15 // in 'parameter_mirrors_test.dart'. |
| 16 |
| 14 class MyReflectable extends Reflectable { | 17 class MyReflectable extends Reflectable { |
| 15 const MyReflectable() | 18 const MyReflectable() |
| 16 : super(typeCapability, invokingCapability, declarationsCapability); | 19 : super(typeCapability, invokingCapability, declarationsCapability); |
| 17 } | 20 } |
| 18 | 21 |
| 19 const myReflectable = const MyReflectable(); | 22 const myReflectable = const MyReflectable(); |
| 20 | 23 |
| 21 @myReflectable | 24 @myReflectable |
| 22 class MyClass { | 25 class MyClass { |
| 23 int arg0() => null; | 26 int arg0() => null; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 expect(namedArgumentsParameter0.type.reflectedType, String); | 163 expect(namedArgumentsParameter0.type.reflectedType, String); |
| 161 expect(namedArgumentsParameter1.isOptional, false); | 164 expect(namedArgumentsParameter1.isOptional, false); |
| 162 expect(namedArgumentsParameter1.type.reflectedType, List); | 165 expect(namedArgumentsParameter1.type.reflectedType, List); |
| 163 expect(namedArgumentsParameter2.isOptional, true); | 166 expect(namedArgumentsParameter2.isOptional, true); |
| 164 expect(namedArgumentsParameter2.isNamed, true); | 167 expect(namedArgumentsParameter2.isNamed, true); |
| 165 expect(namedArgumentsParameter2.type.reflectedType, String); | 168 expect(namedArgumentsParameter2.type.reflectedType, String); |
| 166 expect(namedArgumentsParameter2.hasDefaultValue, true); | 169 expect(namedArgumentsParameter2.hasDefaultValue, true); |
| 167 expect(namedArgumentsParameter2.defaultValue, "42"); | 170 expect(namedArgumentsParameter2.defaultValue, "42"); |
| 168 }); | 171 }); |
| 169 } | 172 } |
| OLD | NEW |