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

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

Issue 706793002: Remove/skip invalid mirror tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 // Ensure that objects handled specially by dart2js can be reflected on. 5 // Ensure that objects handled specially by dart2js can be reflected on.
6 6
7 library test.intercepted_object_test; 7 library test.intercepted_object_test;
8 8
9 import 'dart:mirrors'; 9 import 'dart:mirrors';
10 10
11 import 'stringify.dart' show stringify, expect; 11 import 'stringify.dart' show stringify, expect;
12 12
13 import 'intercepted_class_test.dart' show checkClassMirrorMethods; 13 import 'intercepted_class_test.dart' show checkClassMirrorMethods;
14 14
15 checkImplements(object, String name) { 15 checkImplements(object, String name) {
16 ClassMirror cls = reflect(object).type; 16 ClassMirror cls = reflect(object).type;
17 checkClassMirrorMethods(cls); 17 checkClassMirrorMethods(cls);
18 18
19 List<ClassMirror> superinterfaces = cls.superinterfaces; 19 List<ClassMirror> superinterfaces = cls.superinterfaces;
20 String symName = 's($name)'; 20 String symName = 's($name)';
21 for (ClassMirror superinterface in superinterfaces) { 21 for (ClassMirror superinterface in superinterfaces) {
22 print(superinterface.simpleName); 22 print(superinterface.simpleName);
23 if (symName == stringify(superinterface.simpleName)) { 23 if (symName == stringify(superinterface.simpleName)) {
24 checkClassMirrorMethods(superinterface); 24 checkClassMirrorMethods(superinterface);
25 return; 25 return;
26 } 26 }
27 } 27 }
28
29 if (symName == stringify(cls.simpleName)) {
30 checkClassMirrorMethods(cls);
31 return;
32 }
gbracha 2014/11/06 00:51:17 This just adds the reflexive case, i.e. class C im
rmacnak 2014/11/06 01:02:49 Added.
28 33
29 // TODO(floitsch): use correct fail 34 // TODO(floitsch): use correct fail
30 expect(name, "super interface not found"); 35 expect(name, "super interface not found");
31 } 36 }
32 37
33 main() { 38 main() {
34 checkImplements('', 'String'); 39 checkImplements('', 'String');
35 checkImplements(1, 'int'); 40 checkImplements(1, 'int');
36 checkImplements(1.5, 'double'); 41 checkImplements(1.5, 'double');
37 checkImplements(true, 'bool'); 42 checkImplements(true, 'bool');
38 checkImplements(false, 'bool'); 43 checkImplements(false, 'bool');
39 checkImplements([], 'List'); 44 checkImplements([], 'List');
40 } 45 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/hierarchy_test.dart ('k') | tests/lib/mirrors/mirrors_used_typedef_declaration_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698