Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Side by Side Diff: tests/lib/mirrors/operator_test.dart

Issue 64793003: Update mirror tests for removed API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: . Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 operators. 5 /// Test operators.
6 library test.operator_test; 6 library test.operator_test;
7 7
8 import 'dart:mirrors'; 8 import 'dart:mirrors';
9 9
10 import 'package:expect/expect.dart'; 10 import 'package:expect/expect.dart';
(...skipping 24 matching lines...) Expand all
35 35
36 // TODO(ahe): use void when dart2js reifies that type. 36 // TODO(ahe): use void when dart2js reifies that type.
37 operator []=(int a, Foo b) {} 37 operator []=(int a, Foo b) {}
38 } 38 }
39 39
40 void main() { 40 void main() {
41 ClassMirror cls = reflectClass(Foo); 41 ClassMirror cls = reflectClass(Foo);
42 var operators = new Map<Symbol, MethodMirror>(); 42 var operators = new Map<Symbol, MethodMirror>();
43 var operatorParameters = new Map<Symbol, List>(); 43 var operatorParameters = new Map<Symbol, List>();
44 var returnTypes = new Map<Symbol, Mirror>(); 44 var returnTypes = new Map<Symbol, Mirror>();
45 for (MethodMirror method in cls.methods.values) { 45 for (MethodMirror method in cls.declarations.values.where(
46 (d) => d is MethodMirror && !d.isConstructor)) {
46 Expect.isTrue(method.isRegularMethod); 47 Expect.isTrue(method.isRegularMethod);
47 Expect.isTrue(method.isOperator); 48 Expect.isTrue(method.isOperator);
48 Expect.isFalse(method.isGetter); 49 Expect.isFalse(method.isGetter);
49 Expect.isFalse(method.isSetter); 50 Expect.isFalse(method.isSetter);
50 Expect.isFalse(method.isAbstract); 51 Expect.isFalse(method.isAbstract);
51 operators[method.simpleName] = method; 52 operators[method.simpleName] = method;
52 operatorParameters[method.simpleName] = method.parameters; 53 operatorParameters[method.simpleName] = method.parameters;
53 returnTypes[method.simpleName] = method.returnType; 54 returnTypes[method.simpleName] = method.returnType;
54 } 55 }
55 expect(OPERATORS, operators); 56 expect(OPERATORS, operators);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 '>=: $FOO, ' 128 '>=: $FOO, '
128 '>>: $FOO, ' 129 '>>: $FOO, '
129 '[]: $FOO, ' 130 '[]: $FOO, '
130 '[]=: $DYNAMIC, ' 131 '[]=: $DYNAMIC, '
131 '^: $FOO, ' 132 '^: $FOO, '
132 'unary-: $FOO, ' 133 'unary-: $FOO, '
133 '|: $FOO, ' 134 '|: $FOO, '
134 '~: $FOO, ' 135 '~: $FOO, '
135 '~/: $FOO' 136 '~/: $FOO'
136 '}'; 137 '}';
OLDNEW
« no previous file with comments | « tests/lib/mirrors/mixin_members_test.dart ('k') | tests/lib/mirrors/parameter_metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698