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

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

Issue 2727323002: Add @MirrorsUsed annotations to speed up tests. (Closed)
Patch Set: Minor fixes. Created 3 years, 9 months 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
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 library test.instance_members_unimplemented_interface; 5 library test.instance_members_unimplemented_interface;
6 6
7 @MirrorsUsed(targets: "test.instance_members_unimplemented_interface")
7 import 'dart:mirrors'; 8 import 'dart:mirrors';
8 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
9 10
10 class I { 11 class I {
11 implementMe() {} 12 implementMe() {}
12 } 13 }
13 abstract class C implements I {} 14 abstract class C implements I {}
14 15
15 selectKeys(map, predicate) { 16 selectKeys(map, predicate) {
16 return map.keys.where((key) => predicate(map[key])); 17 return map.keys.where((key) => predicate(map[key]));
17 } 18 }
18 19
19 main() { 20 main() {
20 ClassMirror cm = reflectClass(C); 21 ClassMirror cm = reflectClass(C);
21 22
22 // N.B.: Does not include #implementMe. 23 // N.B.: Does not include #implementMe.
23 Expect.setEquals( 24 Expect.setEquals(
24 [#hashCode, 25 [#hashCode,
25 #runtimeType, 26 #runtimeType,
26 #==, 27 #==,
27 #noSuchMethod, 28 #noSuchMethod,
28 #toString], 29 #toString],
29 selectKeys(cm.instanceMembers, (dm) => !dm.isPrivate)); 30 selectKeys(cm.instanceMembers, (dm) => !dm.isPrivate));
30 // Filter out private to avoid implementation-specific members of Object. 31 // Filter out private to avoid implementation-specific members of Object.
31 } 32 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/instance_members_test.dart ('k') | tests/lib/mirrors/instance_members_with_override_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698