| OLD | NEW |
| 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 of [ParameterMirror]. | 5 // This tests uses the multi-test "ok" feature: |
| 6 // none: Desired behaviour, passing on the VM. |
| 7 // 01: Trimmed version for dart2js. |
| 8 // |
| 9 // TODO(rmacnak,ahe): Remove multi-test when VM and dart2js are on par. |
| 10 |
| 11 /** Test of [ParameterMirror]. */ |
| 6 library test.parameter_test; | 12 library test.parameter_test; |
| 7 | 13 |
| 8 @MirrorsUsed(targets: 'test.parameter_test', override: '*') | 14 @MirrorsUsed(targets: 'test.parameter_test', override: '*') |
| 9 import 'dart:mirrors'; | 15 import 'dart:mirrors'; |
| 10 | 16 |
| 11 import 'package:expect/expect.dart'; | 17 import 'package:expect/expect.dart'; |
| 12 import 'stringify.dart'; | 18 import 'stringify.dart'; |
| 13 | 19 |
| 14 class B { | 20 class B { |
| 15 B(); | 21 B(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 MethodMirror barConstructor = constructors[const Symbol('B.bar')]; | 70 MethodMirror barConstructor = constructors[const Symbol('B.bar')]; |
| 65 expect('Method(s(B.bar) in s(B), constructor)', barConstructor); | 71 expect('Method(s(B.bar) in s(B), constructor)', barConstructor); |
| 66 expect('[Parameter(s(z) in s(B.bar),' | 72 expect('[Parameter(s(z) in s(B.bar),' |
| 67 ' type = Class(s(int) in s(dart.core), top-level)), ' | 73 ' type = Class(s(int) in s(dart.core), top-level)), ' |
| 68 'Parameter(s(x) in s(B.bar),' | 74 'Parameter(s(x) in s(B.bar),' |
| 69 ' type = Type(s(dynamic), top-level))]', | 75 ' type = Type(s(dynamic), top-level))]', |
| 70 barConstructor.parameters); | 76 barConstructor.parameters); |
| 71 expect('Class(s(B) in s(test.parameter_test), top-level)', | 77 expect('Class(s(B) in s(test.parameter_test), top-level)', |
| 72 barConstructor.returnType); | 78 barConstructor.returnType); |
| 73 | 79 |
| 80 // dart2js stops testing here. |
| 81 return; /// 01: ok |
| 82 |
| 74 MethodMirror bazConstructor = constructors[const Symbol('B.baz')]; | 83 MethodMirror bazConstructor = constructors[const Symbol('B.baz')]; |
| 75 expect('Method(s(B.baz) in s(B), constructor)', bazConstructor); | 84 expect('Method(s(B.baz) in s(B), constructor)', bazConstructor); |
| 76 expect('[Parameter(s(x) in s(B.baz), final,' | 85 expect('[Parameter(s(x) in s(B.baz), final,' |
| 77 ' type = Class(s(int) in s(dart.core), top-level)), ' | 86 ' type = Class(s(int) in s(dart.core), top-level)), ' |
| 78 'Parameter(s(y) in s(B.baz),' | 87 'Parameter(s(y) in s(B.baz),' |
| 79 ' type = Class(s(int) in s(dart.core), top-level)), ' | 88 ' type = Class(s(int) in s(dart.core), top-level)), ' |
| 80 'Parameter(s(z) in s(B.baz), final,' | 89 'Parameter(s(z) in s(B.baz), final,' |
| 81 ' type = Class(s(int) in s(dart.core), top-level))]', | 90 ' type = Class(s(int) in s(dart.core), top-level))]', |
| 82 bazConstructor.parameters); | 91 bazConstructor.parameters); |
| 83 expect('Class(s(B) in s(test.parameter_test), top-level)', | 92 expect('Class(s(B) in s(test.parameter_test), top-level)', |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 expect('[Parameter(s(a) in s(bar),' | 173 expect('[Parameter(s(a) in s(bar),' |
| 165 ' type = TypeVariable(s(S) in s(C),' | 174 ' type = TypeVariable(s(S) in s(C),' |
| 166 ' upperBound = Class(s(int) in s(dart.core), top-level))), ' | 175 ' upperBound = Class(s(int) in s(dart.core), top-level))), ' |
| 167 'Parameter(s(b) in s(bar),' | 176 'Parameter(s(b) in s(bar),' |
| 168 ' type = TypeVariable(s(T) in s(C),' | 177 ' type = TypeVariable(s(T) in s(C),' |
| 169 ' upperBound = Class(s(Object) in s(dart.core), top-level))), ' | 178 ' upperBound = Class(s(Object) in s(dart.core), top-level))), ' |
| 170 'Parameter(s(c) in s(bar),' | 179 'Parameter(s(c) in s(bar),' |
| 171 ' type = Class(s(num) in s(dart.core), top-level))]', | 180 ' type = Class(s(num) in s(dart.core), top-level))]', |
| 172 barInC.parameters); | 181 barInC.parameters); |
| 173 } | 182 } |
| OLD | NEW |